This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
gcc 3.0.1 preprocessor bug
- To: gcc at gcc dot gnu dot org
- Subject: gcc 3.0.1 preprocessor bug
- From: Andy Tai <lichengtai at yahoo dot com>
- Date: Mon, 20 Aug 2001 20:20:54 -0700 (PDT)
- Cc: atai at atai dot org
- Reply-To: atai at atai dot org
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:
---t.cc---
struct s
{
int x;
};
#define m(a) x_##a##0_x.x
main()
{
struct s x_10_x;
m(1) = 2;
}
---end of t.cc---
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 t.cc
t.cc:12:4: warning: pasting "x_1" and "0_x.x" does not
give a valid preprocessing token
t.cc: In function `int main()':
t.cc:12: underscore in number
t.cc:12: `x_1' undeclared (first use this function)
t.cc:12: (Each undeclared identifier is reported only
once for each function it appears in.)
t.cc:12: parse error before numeric constant
% gcc -v
Reading specs from
/share/software/gcc-3/installed/lib/gcc-lib/i686-pc-linux-gnu/3.0.1/specs
Configured with: ../gcc-3.0.1/configure
--prefix=/share/software/gcc-3/installed
--enable-threads
Thread model: posix
gcc version 3.0.1
Thanks for any work arounds on this.
__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/