diff options
author | Neil Booth <neilb@earthling.net> | 2000-09-28 05:55:22 +0000 |
---|---|---|
committer | Neil Booth <neil@gcc.gnu.org> | 2000-09-28 05:55:22 +0000 |
commit | d8090680186229102bf95754d5117c9f3fb139fa (patch) | |
tree | e397904d152d2097125d59904f15ea71e0957eb9 /gcc/cpplex.c | |
parent | e93eff9433088e058245212256b3f03f34562817 (diff) | |
download | gcc-d8090680186229102bf95754d5117c9f3fb139fa.zip gcc-d8090680186229102bf95754d5117c9f3fb139fa.tar.gz gcc-d8090680186229102bf95754d5117c9f3fb139fa.tar.bz2 |
cpperror.c (_cpp_begin_message): Do the test for suppression of warnings and pedantic warnings before the "is a...
* cpperror.c (_cpp_begin_message): Do the test for suppression
of warnings and pedantic warnings before the "is a warning an
error" tests.
* cppinit.c (cpp_handle_option): Remove surplus \n.
* cpplex.c (ON_REST_ARG): Delete.
(skip_block_comment): Initialise prevc.
(parse_args): Improve error messages.
(maybe_paste_with_next): Use CONTEXT_VARARGS rather
than ON_REST_ARG.
* cpplib.c (cpp_push_buffer): Fix grammar in message.
* cppmain.c (main): Set callbacks for #ident and #pragma
only if no_output option is false.
(do_pragma_implementation): Only call the #pragma handler
if it is set in the cpp_reader structure.
From-SVN: r36655
Diffstat (limited to 'gcc/cpplex.c')
-rw-r--r-- | gcc/cpplex.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/gcc/cpplex.c b/gcc/cpplex.c index 4b2f84b..426e82d 100644 --- a/gcc/cpplex.c +++ b/gcc/cpplex.c @@ -162,10 +162,6 @@ TOKEN_LEN (token) #define IS_ARG_CONTEXT(c) ((c)->flags & CONTEXT_ARG) #define CURRENT_CONTEXT(pfile) ((pfile)->contexts + (pfile)->cur_context) -#define ON_REST_ARG(c) \ - (((c)->u.list->flags & VAR_ARGS) \ - && (c)->u.list->tokens[(c)->posn - 1].val.aux \ - == (unsigned int) ((c)->u.list->paramc - 1)) #define ASSIGN_FLAGS_AND_POS(d, s) \ do {(d)->flags = (s)->flags & (PREV_WHITE | BOL | PASTE_LEFT); \ @@ -573,7 +569,7 @@ skip_block_comment (pfile) cpp_reader *pfile; { cpp_buffer *buffer = pfile->buffer; - cppchar_t c = EOF, prevc; + cppchar_t c = EOF, prevc = EOF; pfile->state.lexing_comment = 1; while (buffer->cur != buffer->rlimit) @@ -1837,6 +1833,7 @@ is_macro_disabled (pfile, expansion, token) pfile->no_expand_level = context - pfile->contexts; next = _cpp_get_token (pfile); restore_macro_expansion (pfile, prev_nme); + if (next->type != CPP_OPEN_PAREN) { _cpp_push_token (pfile, next); @@ -2001,7 +1998,8 @@ parse_args (pfile, hp, args) } else { - cpp_error (pfile, "not enough arguments for macro \"%s\"", hp->name); + cpp_error (pfile, "%u arguments is not enough for macro \"%s\"", + argc, hp->name); return 1; } } @@ -2009,7 +2007,8 @@ parse_args (pfile, hp, args) else if (argc > macro->paramc && !(macro->paramc == 0 && argc == 1 && empty_argument (args, 0))) { - cpp_error (pfile, "too many arguments for macro \"%s\"", hp->name); + cpp_error (pfile, "%u arguments is too many for macro \"%s\"", + argc, hp->name); return 1; } @@ -2331,8 +2330,8 @@ maybe_paste_with_next (pfile, token) <whatever> came from a variable argument, because the author probably intended the ## to trigger the special extended semantics (see above). */ - if (token->type == CPP_COMMA && IS_ARG_CONTEXT (context) - && ON_REST_ARG (context - 1)) + if (token->type == CPP_COMMA + && (context->flags & CONTEXT_VARARGS)) /* no warning */; else cpp_warning (pfile, |