On Feb 20, 2012, at 11:35 AM, Joerg Sonnenberger <[email protected]> 
wrote:

> On Mon, Feb 20, 2012 at 11:02:25AM -0800, Ted Kremenek wrote:
>> (1) Warn about non-standard format strings only when it is an issue
>> for the target platform.  This is hard to do, but this is basically
>> what users will expect.
> 
> IMO most of the format extensions are of questionable value (%m),
> outdated historic extensions (q modifier) or just plainly unportable (S
> modifier).

I hear you, but some extensions continue to be advocated and used.  For 
example, consider this document:

  
https://developer.apple.com/library/mac/#documentation/CoreFoundation/Conceptual/CFStrings/formatSpecifiers.html

Here 'q' is plainly advocated as a method for printing out 64-bit integers.  
This contrasts with Mac OS X's man page for printf, which clearly points to the 
length modifier 'q' as being deprecated.  Maybe the documentation just needs to 
be updated, or maybe 'q' should just continue to make sense for Objective-C 
strings, but there's a fair amount of subjectiveness here and it is confusing 
for developers.

I'd be a lot more happy with this discussion if we took the patch with the 
proposed change, ran it over a ton of code, and observed the warning fallout.  
If it's insignificant or reasonable, I think that's a reasonable place to start 
a conversation about having such warnings on by default.
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to