This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Suppressing specific compiler warnings
- From: Geert Bosch <bosch at gnat dot com>
- To: "Banibrata Dutta" <dutta at india dot hp dot com>
- Cc: <gcc at gnu dot org>
- Date: Wed, 26 May 2004 14:08:02 -0400
- Subject: Re: Suppressing specific compiler warnings
- References: <002f01c442fa$1091bbe0$c0714c0f@nt13192>
On May 26, 2004, at 04:18, Banibrata Dutta wrote:
I've wondered for a long time as to why the ability to suppress
specific
compiler warnings is missing in GCC.
Has this ever been discussed ? Having this would be very useful in
cases
where we treat warnings and errors and cause build to break. At times
there
are warnings which we decide to live with, because they reflect a
deliberate
decision.
Maintaining options for every warning is a huge maintenance burden
(as is numbered warnings), and still causes problems when we change
warnings.
For GNAT, we found suppression warnings for a specific section of
code, or for an entity (variable/type/function etc) works very well.
Naturally, every use of the pragma to switch off warnings should have
a comment indicating why the suspect code is in fact OK.
This scheme is easy to maintain and should work for C/C++ as well.
-Geert