This is the mail archive of the gcc-bugs@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]

g++/cpp problem with macros expanding to /##/


Neither Preprocessor nor Comiler passes discard preprocessor "generated"
comments.
Any recommendations?

The "/##/" macro technique is a fairly common practice that eliminates
the need for a lot of ifdef's sprinkled throughout a large ported
project.

Sample code fragment:
#define using /##/
using :: exception;

g++ -E -C -dD output:
#define using /##/
// :: exception;

g++ -c error message:
<file>:<line>: parse error before '/'

Red Hat 5.1 Linux box set g++ -v reports:
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.90.27/specs
egcs-2.90.27 980315 (egcs-1.0.2 release)




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