[Bug preprocessor/55820] New: cpp: unterminated argument list invoking macro "BAR" for #include in macro

gerald at pfeifer dot com gcc-bugzilla@gcc.gnu.org
Fri Dec 28 02:03:00 GMT 2012


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"
 ^



More information about the Gcc-bugs mailing list