public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug preprocessor/55820] New: cpp: unterminated argument list invoking macro "BAR" for #include in macro
@ 2012-12-28  2:03 gerald at pfeifer dot com
  2012-12-28  4:07 ` [Bug preprocessor/55820] " pinskia at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: gerald at pfeifer dot com @ 2012-12-28  2:03 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 55820
           Summary: cpp: unterminated argument list invoking macro "BAR"
                    for #include in macro
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: preprocessor
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: gerald@pfeifer.com


The following was reported to me, and while I am not sure it is
fully ISO C, I am told clang accepts this.

% more test.*
::::::::::::::
test.c
::::::::::::::
#define BAR(x)  x
BAR(
  "<"
#include "test.h"
  ">"
)
::::::::::::::
test.h
::::::::::::::
"foo"


% ~/gcc-x86_64/bin/gcc -E test.c >/dev/null
In file included from test.c:5:0:
test.h:1:0: error: unterminated argument list invoking macro "BAR"
 "foo"
 ^


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

* [Bug preprocessor/55820] cpp: unterminated argument list invoking macro "BAR" for #include in macro
  2012-12-28  2:03 [Bug preprocessor/55820] New: cpp: unterminated argument list invoking macro "BAR" for #include in macro gerald at pfeifer dot com
@ 2012-12-28  4:07 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-12-28  4:07 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-12-28 04:07:14 UTC ---
yes this code is undefined at compile time.  GCC used to reject #define in a
macro usage but it was decided we will accept that.  I can find the old bugs if
needed.


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

end of thread, other threads:[~2012-12-28  4:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-28  2:03 [Bug preprocessor/55820] New: cpp: unterminated argument list invoking macro "BAR" for #include in macro gerald at pfeifer dot com
2012-12-28  4:07 ` [Bug preprocessor/55820] " pinskia at gcc dot gnu.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).