This is the mail archive of the 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: gcc 3.0.1 preprocessor bug

If you put a space before the dot in m(a)
so it will become:
#define m(a) x_##a##0_x .x
This is not a work around; this is the solution.

The error message is correct pasting the two will not give a valid preprocessing token.

Andrew Pinski
Student of Computer Science
University of Cincinnati

On Monday, August 20, 2001, at 11:20 PM, Andy Tai wrote:

Hi, this seems a bug in the preprocessor of gcc 3.0.1
but I am not sure so I post here first.

sample code:

struct s
int x;

#define m(a) x_##a##0_x.x

struct s x_10_x;
m(1) = 2;


---end of

with gcc 2.95.3 on GNU/Linux (Red Hat 7.1), no error.

with gcc 3.0.1 on the same machine, gcc says

% gcc warning: pasting "x_1" and "0_x.x" does not
give a valid preprocessing token In function `int main()': underscore in number `x_1' undeclared (first use this function) (Each undeclared identifier is reported only
once for each function it appears in.) parse error before numeric constant

% gcc -v
Reading specs from
Configured with: ../gcc-3.0.1/configure
Thread model: posix
gcc version 3.0.1

Thanks for any work arounds on this.

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