On Aug 7, 2012, at 11:08 AM, Hans Wennborg <[email protected]> wrote:

> On Tue, Aug 7, 2012 at 6:12 PM, Peter Cooper <[email protected]> wrote:
>> Hi Hans,
>> 
>> This series of commits seems to be breaking the gcc test suite.  Could you 
>> please investigate?
>> 
>> The output we have is
> 
>> gcc.dg/format/c90-printf-1.c   bad argument types (test for warnings, line 
>> 200)
>> gcc.dg/format/c90-printf-1.c  -DWIDE  bad argument types (test for warnings, 
>> line 200)
> 
> This is: printf ("%n", un);
> 
> Where 'un' is 'unsigned int *'. GCC warns in -pedantic mode that it
> expects 'int *', but Clang doesn't warn since it doesn't do anything
> special with -pedantic for this kind of checks.
> 
>> gcc.dg/format/c99-printf-1.c   %hhn plain char (test for warnings, line 195)
>> gcc.dg/format/c99-printf-1.c   %hhn unsigned char (test for warnings, line 
>> 196)
>> gcc.dg/format/c99-printf-1.c  -DWIDE  %hhn plain char (test for warnings, 
>> line 195)
>> gcc.dg/format/c99-printf-1.c  -DWIDE  %hhn unsigned char (test for warnings, 
>> line 196)
> 
> Same thing here: gcc in -pedantic mode warns that it expects 'signed
> char *', not 'char *' or 'unsigned char *'. Clang again doesn't do
> anything special with -pedantic.
> 
> 
> The reason some of these tests passed before was that since my
> r160966, Clang would warn about any use of %n where the argument
> wasn't exactly 'int*'. This was wrong, and broke a lot of other tests
> in the suite, so the current results are a net win :)
> 
> We could make -Wformat do strict argument checking with -pedantic, but
> I don't know how important that is?

Emulating GCC's behavior here adds no value other than to have compatibility 
with GCC.
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to