[cfe-commits] r140777 - in /cfe/trunk: lib/Sema/SemaChecking.cpp test/Sema/format-strings.c

Ahmed Charles ahmedcharles at gmail.com
Fri Sep 30 23:12:07 CDT 2011


Yes, that is what I meant.
------------------------------
From: David Blaikie
Sent: 9/30/2011 11:19 AM
To: kremenek at apple.com
Cc: Ahmed Charles; Joerg Sonnenberger; llvm cfe
Subject: Re: [cfe-commits] r140777 - in /cfe/trunk:
lib/Sema/SemaChecking.cpp test/Sema/format-strings.c

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cs.uiuc.edu/pipermail/cfe-commits/attachments/20110930/59f75a75/attachment.html 


More information about the cfe-commits mailing list