public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/28768]  New: Preprocessor doesn't parse tokens correctly?
@ 2006-08-18  5:07 beethoven3322 at hotmail dot com
  2006-08-18  5:11 ` [Bug c/28768] [4.0/4.1/4.2 Regression] " pinskia at gcc dot gnu dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 11+ messages in thread
From: beethoven3322 at hotmail dot com @ 2006-08-18  5:07 UTC (permalink / raw)
  To: gcc-bugs

The following C program will not compile with the command "gcc file.c":

#define FIRST "This is a split
int main() {
   printf( FIRST string");
}

It gives the expected error message about the malformed preprocessor token.
However if the output of "cpp file.c" or "gcc -E file.c" is saved and fed back
into gcc then it DOES compile and run. Here is the output of "gcc -E file.c":

int main() {
   printf( "This is a split string");
}

I checked the ANSI standard and this is indeed an illegal program. Shouldn't
the preprocessor give an error message when run alone?


-- 
           Summary: Preprocessor doesn't parse tokens correctly?
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: beethoven3322 at hotmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28768


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2006-09-13  2:28 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-18  5:07 [Bug c/28768] New: Preprocessor doesn't parse tokens correctly? beethoven3322 at hotmail dot com
2006-08-18  5:11 ` [Bug c/28768] [4.0/4.1/4.2 Regression] " pinskia at gcc dot gnu dot org
2006-08-23 13:16   ` Neil Booth
2006-08-18  6:31 ` beethoven3322 at hotmail dot com
2006-08-20 22:51 ` mmitchel at gcc dot gnu dot org
2006-08-20 23:07 ` joseph at codesourcery dot com
2006-08-21  5:12 ` pinskia at gcc dot gnu dot org
2006-08-21 18:29 ` janis at gcc dot gnu dot org
2006-08-23 13:16 ` neil at daikokuya dot co dot uk
2006-09-13  1:04 ` jsm28 at gcc dot gnu dot org
2006-09-13  2:28 ` jsm28 at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).