From bfab56e7ab02ea2616f98cdd1681a5dcc078e189 Mon Sep 17 00:00:00 2001 From: Zack Weinberg Date: Sun, 2 Apr 2000 22:50:55 +0000 Subject: cppinit.c (cpp_start_read): Turn off -Wtraditional if processing C++. * cppinit.c (cpp_start_read): Turn off -Wtraditional if processing C++. * cpplib.c (_cpp_handle_directive): Improve warnings for traditional C and indented directives. * enquire.c, gsyslimits.h, limity.h, config/convex/fixinc.convex, fixinc/fixinc.irix, fixinc/fixinc.sco, fixinc/fixinc.wrap, fixinc/inclhack.def: Indent the # of #include_next one space. * cp/rtti.c: Un-indent #if and #endif. * cppexp.c (_cpp_parse_expr): If lex returns '#', it's a syntax error, but an error has already been printed. * cpplex.c (_cpp_parse_assertion): Give a more specific error message when called with nothing remaining on the line. (_cpp_lex_token): If _cpp_parse_assertion fails, return an OTHER token, not an ASSERTION. * cpplib.c (do_assert): When we create a 'base' node, clear its aschain pointer. * gcc.c-torture/compile/981211-1.c: Move to... * gcc.dg/cpp-as1.c: ...here. * gcc.dg/cpp-as2.c: New file. * gcc.dg/cpp-tradwarn1.c: Change warning regexps to match the compiler. From-SVN: r32870 --- gcc/cpplib.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'gcc/cpplib.c') diff --git a/gcc/cpplib.c b/gcc/cpplib.c index 747f6f5..2c24de8 100644 --- a/gcc/cpplib.c +++ b/gcc/cpplib.c @@ -232,11 +232,11 @@ _cpp_handle_directive (pfile) if (CPP_WTRADITIONAL (pfile)) { if (!hash_at_bol && dtable[i].origin == KANDR) - cpp_warning (pfile, "the # in #%s should be at the left margin", + cpp_warning (pfile, "traditional C ignores #%s with the # indented", dtable[i].name); else if (hash_at_bol && dtable[i].origin != KANDR) cpp_warning (pfile, - "the # in #%s should not be at the left margin", + "traditional C rejects #%s unless the # is indented", dtable[i].name); } @@ -1658,7 +1658,10 @@ do_assert (pfile) bslot = _cpp_lookup_slot (pfile, sym, blen, 1, &bhash); if (! *bslot) - *bslot = base = _cpp_make_hashnode (sym, blen, T_ASSERT, bhash); + { + *bslot = base = _cpp_make_hashnode (sym, blen, T_ASSERT, bhash); + base->value.aschain = 0; + } else { base = *bslot; -- cgit v1.1