Selectiv on/off-turning of warnings
Martin v. Loewis
martin@loewis.home.cs.tu-berlin.de
Wed Mar 22 15:58:00 GMT 2000
> Does there exists a possibility to turn off some warnings in certain
> parts of the code?
Not at the moment, no. It is a frequently-discussed topic, with
proponents and people arguing against it. So far, these discussions
never caused any actions.
> 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'
Well, that's clearly a bug in straits.h. The correct action would be
to fix that, instead of providing more options to the compiler. The
compiler does not produce certain warnings for system header files.
> A reasonable solution could be something like:
I think there would be a long debate whether it is reasonable. For one
thing, some people claim that #pragma is not reasonable. Since the
standard says a compiler can do anything it wants when it sees a
#pragma, I believe some version of gcc used to invoke Emacs when it
saw a #pragma :-)
Regards,
Martin
More information about the Gcc
mailing list