diff options
author | Zack Weinberg <zack@wolery.cumb.org> | 2000-04-02 22:50:55 +0000 |
---|---|---|
committer | Zack Weinberg <zack@gcc.gnu.org> | 2000-04-02 22:50:55 +0000 |
commit | bfab56e7ab02ea2616f98cdd1681a5dcc078e189 (patch) | |
tree | b00fb305180d6ad00464b0f8d26982c399a9faa0 /gcc/cpplex.c | |
parent | 7c3bb1deecbcda27683c0fccca91987b32eb292e (diff) | |
download | gcc-bfab56e7ab02ea2616f98cdd1681a5dcc078e189.zip gcc-bfab56e7ab02ea2616f98cdd1681a5dcc078e189.tar.gz gcc-bfab56e7ab02ea2616f98cdd1681a5dcc078e189.tar.bz2 |
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
Diffstat (limited to 'gcc/cpplex.c')
-rw-r--r-- | gcc/cpplex.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/gcc/cpplex.c b/gcc/cpplex.c index b0d3f5f..a57eb8b 100644 --- a/gcc/cpplex.c +++ b/gcc/cpplex.c @@ -604,7 +604,12 @@ _cpp_parse_assertion (pfile) int c, dropwhite; _cpp_skip_hspace (pfile); c = PEEKC(); - if (! is_idstart(c)) + if (c == '\n') + { + cpp_error (pfile, "assertion without predicate"); + return 0; + } + else if (! is_idstart(c)) { cpp_error (pfile, "assertion predicate is not an identifier"); return 0; @@ -709,8 +714,9 @@ _cpp_lex_token (pfile) if (pfile->parsing_if_directive) { _cpp_skip_hspace (pfile); - _cpp_parse_assertion (pfile); - return CPP_ASSERTION; + if (_cpp_parse_assertion (pfile)) + return CPP_ASSERTION; + goto randomchar; } if (pfile->parsing_define_directive && ! CPP_TRADITIONAL (pfile)) |