This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Annoying pre-processor fluke.
- To: scherrey at proteus-tech dot com
- Subject: Re: Annoying pre-processor fluke.
- From: Alexandre Oliva <oliva at dcc dot unicamp dot br>
- Date: 05 Oct 1998 08:20:51 -200
- Cc: egcs at cygnus dot com
- References: <3618599F.41265C53@switchco.com>
Benjamin Scherrey <scherrey@switchco.com> writes:
> I'm running egcs1.1 on HPUx and my debug preprocessor code that I've
> run on other compilers (can't guarantee it was egcs though) is suddenly
> breaking my build
> #define PDBUG /##/ Junk
> PDBUG << "This is a debug message." << endl;
This is not Standard C++. According to the Standard,
comment-stripping must take place before macro expansion. In this
particular case, you can define:
#define PDBUG 0 || cerr
--
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil