How to turn off a warning for one line of code.
Alexandre Oliva
oliva@dcc.unicamp.br
Sat Oct 10 06:10:00 GMT 1998
Benjamin Scherrey <scherrey@switchco.com> writes:
> #define PDBUG false && cout
> PDBUG << "My error message..." << endl;
> Now this code generates warnings that say:
> warning: statement with no effect
If you can assume an expression that starts with PDBUG can be an
statement, you can `#define PDBUG if (false) cout'. This won't
produce any warning.
--
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:oliva@gnu.org mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil
More information about the Gcc
mailing list