[cfe-dev] warning with conditional operator and printf, is this a bug ?

Ted Kremenek kremenek at apple.com
Fri Nov 4 07:15:13 PDT 2011


David,

Can you file a bug report and CC me?

On Nov 4, 2011, at 12:20 AM, John McCall wrote:

> On Nov 3, 2011, at 10:34 PM, David Blaikie wrote:
>>> This is a test case, not sure if its a bug with printf.
>> 
>> I don't believe this is a bug, no.
> 
> It's a clear false positive in our format checker.  Promoting an unsigned value to a wider signed type performs a zero-extend, so the distinction between signed and unsigned formats is irrelevant and either %d or %ud should be acceptable.  (The reverse would not be true:  we should still warn about using unsigned formats with promoted signed types).
> 
> John.
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev




More information about the cfe-dev mailing list