This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Suppressing specific compiler warnings



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]