inconsistent macro behavior

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux