[3873] in Athena Bugs
GCC preprocessor
daemon@ATHENA.MIT.EDU (dussart@ATHENA.MIT.EDU)
Tue Jan 2 13:38:40 1990
From: dussart@ATHENA.MIT.EDU
To: bugs@ATHENA.MIT.EDU
Date: Tue, 02 Jan 90 13:38:14 EST
I tried to use the stringification operator of the GCC preprocessor and
it does not seems to work. This feature is documented in the GCC preprocessor
manual and described in the ANSI C draft. Here is the code I wrote
#define BUF_MAX 128
char buffer [BUF_MAX];
FILE *f;
....
fscanf(f, " %" #BUF_MAX "s \n", buffer);
...
The expected output of the GNU preprocessor was :
fscanf(f, " %" "128" "s \n", buffer);
Instead I got :
fscanf(f, " %" # 128 "s \n", buffer);
I used the -v option (verbose) to make sure gcc was not using the cc
preprocessor, the preprocessor used is GNU CPP version 1.36, file name is
/mit/gnu/vaxlib/gcc-cpp. One of the possible source for this problem is the
compilation of GCC using an out dated bison file for the parser.
J.E. DUSSARTRE (dussart@athena.mit.edu)