cpp macro expansion bug
Mumit Khan
khan@NanoTech.Wisc.EDU
Tue Apr 25 12:35:00 GMT 2000
While trying to bootstrap recent snapshots, came about this odd cpp
behaviour. To reproduce this on any platform, please add the following
to your *predefines specs entry along with whatever's there already:
*predefines:
-D__stdcall=__attribute__((__stdcall__)) -D_stdcall=__attribute__((__stdcall__))
Now preprocess the following (__stdcall expansion recurses):
#define NTAPI __stdcall
NTAPI void foo ();
$ ./xgcc -B./ -specs specs.test -c -E cpp-bug.c
# 1 "cpp-bug.c"
__attribute__((__attribute__((__stdcall__)))) void foo ();
With older gcc using old cpp, I get the expected output:
# 1 "cpp-bug.c"
__attribute__((__stdcall__)) void foo ();
Regards,
Mumit
More information about the Gcc-bugs
mailing list