David,

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)

- Ted

On Sep 30, 2011, at 11:19 AM, David Blaikie wrote:

> The 'format' attribute already states whether or not it takes 'printf' or 
> 'scanf' format strings.  That's not really the issue here.  
> 
> [I think Ahmed was saying that the format string annotation could say whether 
> it's a no-op on empty or not]
>  
> 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.
> 
> 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.
> 
> - David

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to