This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
g++/cpp problem with macros expanding to /##/
- To: "'egcs-bugs at cygnus dot com'" <egcs-bugs at cygnus dot com>
- Subject: g++/cpp problem with macros expanding to /##/
- From: Craig Bridge <Craig dot Bridge at seagatesoftware dot com>
- Date: Fri, 2 Oct 1998 09:40:25 -0400
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)