This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Selectiv on/off-turning of warnings
- To: gcc at gcc dot gnu dot org
- Subject: Selectiv on/off-turning of warnings
- From: Enrico Scholz <Enrico dot Scholz at informatik dot tu-chemnitz dot de>
- Date: 23 Mar 2000 00:12:29 +0100
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