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]

Re: Annoying pre-processor fluke.


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



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