inconsistent macro behavior
Reza Roboubi
reza@parvan.net
Mon Jul 28 07:29:00 GMT 2008
Hi,
this is the test file:
$ cat test.c
#define x "llll
#define y "
char * c =3D x y ;
Now, if I do this:
$ gcc -Wall -E test.c
It works as expected, and produces preprocessed output that is
perfectly compilable.
But, if I do this:
$ gcc -Wall -c test.c -o test.o
Then I get this:
test.c:3: error: missing terminating " character
test.c:3: error: missing terminating " character
test.c:3: error: expected expression before =91;=92 token
The questions are:
a.) What's even going on here? Why the apparent inconsistency?
b.) What _should_ be the correct behavior, both in terms of the
(extended) GNU C language, and also the standard C language?
Thanks so much for your help.
Reza.
More information about the Gcc-help
mailing list