This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
macros parsed wrong
- To: gcc-bugs at gcc dot gnu dot org
- Subject: macros parsed wrong
- From: DJ Delorie <dj at redhat dot com>
- Date: Mon, 11 Dec 2000 18:52:30 -0500
This test case generated from sim/mips build failure gives unexpected
results with "gcc -E foo.c". This is with today's gcc.
#define CONCAT2(a, b) a ## b
#define XCONCAT2(a, b) CONCAT2(a,b)
#define T2H_16(X) endian_t2h_16(X)
#define T2H_M XCONCAT2(T2H_,M)
#define N 16
#define M N
#define unsigned_M XCONCAT2(unsigned_,M)
1 T2H_M
2 unsigned_M
3 T2H_M unsigned_M
The unexpected results are:
# 1 "/tmp/macros.c"
# 9 "/tmp/macros.c"
1 T2H_16 2
unsigned_16
3 T2H_16 XCONCAT2(unsigned_,16)
gcc from RH6.2 gives something more expected:
1 T2H_16
2 unsigned_16
3 T2H_16 unsigned_16