Commit 6f4280ef by Zack Weinberg Committed by Zack Weinberg

cppexp.c: Warn about unary + if -Wtraditional.

	* cppexp.c: Warn about unary + if -Wtraditional.
	* cpplex.c (lex_line): Always set BOL on the first token of a line.

From-SVN: r35239
parent 4e81ae98
2000-07-24 Zack Weinberg <zack@wolery.cumb.org>
* cppexp.c: Warn about unary + if -Wtraditional.
* cpplex.c (lex_line): Always set BOL on the first token of a line.
2000-07-24 Michael Meissner <meissner@redhat.com> 2000-07-24 Michael Meissner <meissner@redhat.com>
* d30v.h (FUNCTION_ARG_KEEP_AS_REFERENCE): Delete references to * d30v.h (FUNCTION_ARG_KEEP_AS_REFERENCE): Delete references to
......
...@@ -849,6 +849,10 @@ _cpp_parse_expr (pfile) ...@@ -849,6 +849,10 @@ _cpp_parse_expr (pfile)
top->value = v2; top->value = v2;
top->unsignedp = unsigned2; top->unsignedp = unsigned2;
top->flags |= HAVE_VALUE; top->flags |= HAVE_VALUE;
if (CPP_WTRADITIONAL (pfile))
cpp_warning (pfile,
"traditional C rejects the unary plus operator");
} }
else else
{ {
......
...@@ -1881,10 +1881,8 @@ lex_line (pfile, list) ...@@ -1881,10 +1881,8 @@ lex_line (pfile, list)
cur_token++->type = CPP_EOF; cur_token++->type = CPP_EOF;
} }
/* Directives, known or not, always start a new line. */ first->flags |= BOL;
if (first_token == 0 || list->tokens[first_token].type == CPP_HASH) if (first_token != 0)
first->flags |= BOL;
else
/* 6.10.3.10: Within the sequence of preprocessing tokens making /* 6.10.3.10: Within the sequence of preprocessing tokens making
up the invocation of a function-like macro, new line is up the invocation of a function-like macro, new line is
considered a normal white-space character. */ considered a normal white-space character. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment