Re: Odd warning on wide char compare

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Josh Boyer wrote:
> On Tue, Dec 15, 2009 at 12:17:04AM +0100, Andi Hellmund wrote:
>   
>> Hey Josh,
>>
>> you don't see any warnings because gcc suppresses warning messages for
>> system headers due to "the assumption that they usually do not indicate real
>> problems and would only make the compiler output harder to read." [taken
>>     
> >from man gcc --> -Wsystem-headers]. You could also see that in the
>   
>> preprocessed file *.i by looking at those lines:
>>
>> # 297 "/usr/include/wchar.h" 3 4
>>
>> This number "3" tells the compiler (including preprocessor) to not emit
>> warnings for system headers (a full listing of flags for the # <line>
>> <function> <flags> directive could be found in the CPP user manual,
>> chapter 9 "preprocessor output")
>>     
>
> Ah!  I don't feel so stupid now (though I probably should have looked
> harder to begin with).  Thank you for the explanation.
>
>   
>> Though, from my understanding of the man page option -Wsystem-headers,
>> after enabling this, you should get the warnings for system headers, but
>> I wasn't able to get them printed with my quite recent version of gcc. :-)
>>     
>
> I didn't get the warning using -Wsystem-headers on gcc 4.3 or 4.4 either,
> but I'm not exactly panicing about it :).
>
> josh
>
>   
Hey Josh,

I ran a bit through the code and found that -Wsystem-headers does not
affect all warnings. In fact, there are some warnings, including yours,
which are explicitly excluded if encountered in a system header file (if
you're interested in the source location, please check c-common.c:3168)

I don't really know why certain warnings are explicitly excluded, but
maybe someone with a longer history in gcc could tell why?? Maybe, it's
worth to change the behavior to include all warnings to conform to the
description of this option or to change the description itsself :-) ?

Andi

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux