gnu.gcc.help
[Top] [All Lists]

inconsistent macro behavior

Subject: inconsistent macro behavior
From: RezaRob <RezaRob@xxxxxxxxx>
Date: Sun, 27 Jul 2008 11:01:52 -0700 (PDT)
Newsgroups: gnu.gcc.help, gnu.gcc.bug

Hi,

this is the test file:

$ cat test.c
#define x "llll
#define y "
char * c = 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 ‘;’ 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.

<Prev in Thread] Current Thread [Next in Thread>
  • inconsistent macro behavior, RezaRob <=