<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div style="word-wrap:break-word"><div>If I understand you correctly, are you saying that we should not worry too much that we don't catch 'printf("")' with my change because we can't know in general whether or not that's the right thing to warn about?  (with regards to empty format strings)</div>
</div></blockquote><div><br></div><div>That was my thinking, yes. I figured this warning was more about mismatching the number of arguments with the number of format specifiers. <br><br>Though now that I look at it the warning is unambiguously "format string is empty" which does make me wonder whether your fix is the right one (& then makes me wonder about the value of that warning - since it's clear that not all functions that take format strings are no-ops on empty).<br>
<br>Is there a separate warning for a mismatched number of format specifiers? (eg: printf("%d", 1, 2); ) That warning would catch the case you've now limited the warn_empty_format_string too (granted, it'd catch other cases too - that might be valid, I suppose people could have generic infrastructure to insert format strings based on a set of available arguments & sometimes they only use a subset of those arguments - but in that case printf("", 1) is no more erroneous than printf("%d", 1, 2) so catching the former in that more general warning makes sense to me, rather than making a further special case for it)</div>
<div><br></div><div>- David</div></div>