diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a8d147ecf9b..d69e2324a13 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2000-07-24 Zack Weinberg + + * 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 * d30v.h (FUNCTION_ARG_KEEP_AS_REFERENCE): Delete references to diff --git a/gcc/cppexp.c b/gcc/cppexp.c index e80f8e882e3..b3442470e36 100644 --- a/gcc/cppexp.c +++ b/gcc/cppexp.c @@ -849,6 +849,10 @@ _cpp_parse_expr (pfile) top->value = v2; top->unsignedp = unsigned2; top->flags |= HAVE_VALUE; + + if (CPP_WTRADITIONAL (pfile)) + cpp_warning (pfile, + "traditional C rejects the unary plus operator"); } else { diff --git a/gcc/cpplex.c b/gcc/cpplex.c index 36beb95ed7d..bbe6f355b77 100644 --- a/gcc/cpplex.c +++ b/gcc/cpplex.c @@ -1881,10 +1881,8 @@ lex_line (pfile, list) cur_token++->type = CPP_EOF; } - /* Directives, known or not, always start a new line. */ - if (first_token == 0 || list->tokens[first_token].type == CPP_HASH) - first->flags |= BOL; - else + first->flags |= BOL; + if (first_token != 0) /* 6.10.3.10: Within the sequence of preprocessing tokens making up the invocation of a function-like macro, new line is considered a normal white-space character. */