Desire gcc option to skip warnings in standard headers

Carlo Wood carlo@runaway.xs4all.nl
Wed Jul 1 00:54:00 GMT 1998


| >  > A #pragma seems more logical, and more flexible too.
| >pragmas are generally frowned upon in gcc.  You'll have a hard time
| >convincing anyone to accept new ones.
| 
| Many of the reasons why pragmas are disliked (not usable in macros
| etc.) are gone with the ISO C9x _Pragma() construct. Of course there
| could be still name collisions of pragma names with other compilers, 
| but that can be easily fixed which a #ifdef (and __attribute__ needs 
| #ifdef magic too)

The reason I thought about #pragma's is because it is more flexible:
allows to turn on and off particular warnings at any line number.
The use of -Woptions are effective for every file and line number.

I don't really care to have the possibility to turn warnings on and off
though, except when it is impossible to write good code that doesn't
cause the warning.  I always use -Wall -Woverloaded-virtual
-Wpointer-arith -Winline -Werror anyway.
There are only a few cases sometimes a bit annoying, like the
"might be used uninitialized".

Having broken system headers is of course a whole different story:
Not everyone is sys admin and able to fix them.

The -Wno-system-headers is actually very good solution to real
problem as originally posted :).

-- 
 Carlo Wood  <carlo@runaway.xs4all.nl>



More information about the Gcc mailing list