From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carlo Wood To: andi@zero.aec dot@(Andi Kleen) Cc: egcs@cygnus.com (egcs@cygnus.com) Subject: Re: Desire gcc option to skip warnings in standard headers Date: Wed, 01 Jul 1998 00:54:00 -0000 Message-id: <199807010111.DAA30576@jolan.ppro> References: <19980630145900.23408.qmail@zero.aec.at> X-SW-Source: 1998-07/msg00019.html | > > 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