[cfe-dev] warning with conditional operator and printf, is this a bug ?
John McCall
rjmccall at apple.com
Fri Nov 4 00:20:22 PDT 2011
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.
More information about the cfe-dev
mailing list