diff options
author | neil <neil@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-11-13 18:40:37 +0000 |
---|---|---|
committer | neil <neil@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-11-13 18:40:37 +0000 |
commit | def71b06d7a16247d173501d8904122ccfe15d41 (patch) | |
tree | 6bca53154943312d4ce1d3788de1f631c994d6c8 /gcc/cpplib.c | |
parent | 8a6748a0b1e52dec27cb724b6054e200ef543849 (diff) | |
download | gcc-def71b06d7a16247d173501d8904122ccfe15d41.tar.gz |
* cpplex.c (_cpp_lex_token): CPP_COMMENT and true CPP_EOF
cases return without MI check.
* cpplib.c (do_diagnostic): Take boolean of whether to
print the directive name.
(do_error, do_warning): Update.
(do_pragma_dependency): Use it.
* cpplib.h (VARARGS_FIRST): Delete.
(struct cpp_token): Delete integer.
* cppmacro.c (enter_macro_context): Move disabled check
to _cpp_get_token.
(_cpp_get_token): Simplify into a single loop.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@37434 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cpplib.c')
-rw-r--r-- | gcc/cpplib.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/gcc/cpplib.c b/gcc/cpplib.c index 159c3db85f5..77cf6cd0c38 100644 --- a/gcc/cpplib.c +++ b/gcc/cpplib.c @@ -91,7 +91,7 @@ static void push_conditional PARAMS ((cpp_reader *, int, int, static int read_line_number PARAMS ((cpp_reader *, int *)); static int strtoul_for_line PARAMS ((const U_CHAR *, unsigned int, unsigned long *)); -static void do_diagnostic PARAMS ((cpp_reader *, enum error_type)); +static void do_diagnostic PARAMS ((cpp_reader *, enum error_type, int)); static cpp_hashnode *lex_macro_node PARAMS ((cpp_reader *)); static void do_pragma_once PARAMS ((cpp_reader *)); static void do_pragma_poison PARAMS ((cpp_reader *)); @@ -792,13 +792,15 @@ do_line (pfile) */ static void -do_diagnostic (pfile, code) +do_diagnostic (pfile, code, print_dir) cpp_reader *pfile; enum error_type code; + int print_dir; { if (_cpp_begin_message (pfile, code, NULL, 0)) { - fprintf (stderr, "#%s ", pfile->directive->name); + if (print_dir) + fprintf (stderr, "#%s ", pfile->directive->name); pfile->state.prevent_expansion++; cpp_output_line (pfile, stderr); pfile->state.prevent_expansion--; @@ -809,14 +811,14 @@ static void do_error (pfile) cpp_reader *pfile; { - do_diagnostic (pfile, ERROR); + do_diagnostic (pfile, ERROR, 1); } static void do_warning (pfile) cpp_reader *pfile; { - do_diagnostic (pfile, WARNING); + do_diagnostic (pfile, WARNING, 1); } /* Report program identification. */ @@ -1085,8 +1087,8 @@ do_pragma_dependency (pfile) cpp_start_lookahead (pfile); cpp_get_token (pfile, &msg); cpp_stop_lookahead (pfile, msg.type == CPP_EOF); - if (msg.type != CPP_EOF && _cpp_begin_message (pfile, WARNING, NULL, 0)) - cpp_output_line (pfile, stderr); + if (msg.type != CPP_EOF) + do_diagnostic (pfile, WARNING, 0); } } |