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]

Selectiv on/off-turning of warnings


Does there exists a possibility to turn off some warnings in certain
parts of the code?

E.g. stuff like "-Weffc++" can detect a lot of nasty errors but it takes
effect on the whole compilation unit---inclusive included system headers
violating style-guides because of performance-purposes. So I get a lot
of useless warnings in which the "real" ones (those _I_ am responsible
for) are hidden.

This happens not only with "-Weffc++", "-ansi -pedantic" produces
e.g.:
/usr/include/g++-3/std/straits.h:86: warning: ANSI C++ forbids variable-size array `a'


A reasonable solution could be something like:

-----
#pragma warnings push
#pragma warnings -effc++
#include <unistd.h>
#pragma warnings pop
-----


Or have I overseen another already existing possibility?





Enrico

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