This is the mail archive of the gcc-bugs@gcc.gnu.org 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]

unexpected parse error in #define


I wouldn't normally expect that continuations lines
would be treated differently when using #define with a
macro that takes arguments vs. one which doesn't. 
Didn't see anything in the CPP manual which describes
this, but don't have a copy of the ANSI standard to
know whether this is specified or not:

[etalvo@hobo etalvo]$ more test.c

#define FOO a \
 { a(); }

[etalvo@hobo etalvo]$ more test3.c

#define FOO(r) a \
 { a(); }

[etalvo@hobo etalvo]$ gcc -c test.c
test.c:3: parse error before `{'
[etalvo@hobo etalvo]$ gcc -c test3.c
[etalvo@hobo etalvo]$

[etalvo@hobo etalvo]$ gcc -v
Reading specs from
/usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/specs
gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2
release)

(this happens with 2.95.2 on Sun Solaris 2.6 as well).

--erik
talvola@yahoo.com


__________________________________________________
Do You Yahoo!?
Yahoo! Photos - 35mm Quality Prints, Now Get 15 Free!
http://photos.yahoo.com/

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