<html><head><meta content="text/html; charset=utf-8" http-equiv="Content-Type"></head><body><div><div style="font-family: Calibri,sans-serif; font-size: 11pt;">Yes, that is what I meant.<br></div></div><hr><span style="font-family: Tahoma,sans-serif; font-size: 10pt; font-weight: bold;">From: </span><span style="font-family: Tahoma,sans-serif; font-size: 10pt;">David Blaikie</span><br>
<span style="font-family: Tahoma,sans-serif; font-size: 10pt; font-weight: bold;">Sent: </span><span style="font-family: Tahoma,sans-serif; font-size: 10pt;">9/30/2011 11:19 AM</span><br><span style="font-family: Tahoma,sans-serif; font-size: 10pt; font-weight: bold;">To: </span><span style="font-family: Tahoma,sans-serif; font-size: 10pt;"><a href="mailto:kremenek@apple.com">kremenek@apple.com</a></span><br>
<span style="font-family: Tahoma,sans-serif; font-size: 10pt; font-weight: bold;">Cc: </span><span style="font-family: Tahoma,sans-serif; font-size: 10pt;">Ahmed Charles; Joerg Sonnenberger; llvm cfe</span><br><span style="font-family: Tahoma,sans-serif; font-size: 10pt; font-weight: bold;">Subject: </span><span style="font-family: Tahoma,sans-serif; font-size: 10pt;">Re: [cfe-commits] r140777 - in /cfe/trunk: lib/Sema/SemaChecking.cpp test/Sema/format-strings.c</span><br>
<br></body></html><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">The 'format' attribute already states whether or not it takes 'printf' or 'scanf' format strings. That's not really the issue here. </div>
</blockquote><div><br></div><div>[I think Ahmed was saying that the format string annotation could say whether it's a no-op on empty or not]</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div style="word-wrap:break-word">The issue is whether or not the function is a no-op given an empty format string. For a 'scanf' format string, it's clearly a no-op given no format string. For a 'printf' format string, that's not necessarily the case.</div>
</blockquote><div><br></div><div>Is it really the job of this warning to catch that case though? Lots of functions are no-ops when passed certain arguments (write of zero length, etc). While it's perhaps a "nice to have"/convenient thing we might be able to get here for low cost compared to any attempt to tackle the general problem, I'm not sure it's worth contorting things to satisfy when it was more a coincidental win than an intentional one.</div>
<div><br></div><div>- David</div></div>