This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Integrated cpp: hack specs so -traditional and -save-temps work



You need to give -fpreprocessed to cc1 when it's got an integrated
preprocessor and it's being fed already-preprocessed output.  It only makes
a difference for pathological cases, but it affects Cx9 compliance.  See
below for a test case which I have not actually tried, but it should give
you the idea.

I don't see any other problems with this patch.  Thanks for doing the work,
btw.

zw

-- test.c --

/* A directive is not recognized if its leading # is embedded within a
   macro.  Nor is it recognized if there's a macro between ^ and the #,
   even if the macro expands to nothing.  See C99 6.10 paragraphs 2, 8.  */

#define HASH #
#define EMPTY

HASH define foo bar	/* { possibly dg-error "syntax error" } */
EMPTY # define baz quux;  /* { ditto } */

extern char foo;
extern char baz;

const int sz1 = sizeof bar;  /* { dg-error "undeclared" } */
const int sz2 = sizeof quux;  /* { ditto } */

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]