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/cppmain.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/cppmain.c')
-rw-r--r-- | gcc/cppmain.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/gcc/cppmain.c b/gcc/cppmain.c index 3e570be..5c88e95 100644 --- a/gcc/cppmain.c +++ b/gcc/cppmain.c @@ -88,15 +88,21 @@ main (argc, argv) return (FATAL_EXIT_CODE); /* Set callbacks. */ - if (! CPP_OPTION (pfile, no_line_commands) - && ! CPP_OPTION (pfile, no_output)) + if (! CPP_OPTION (pfile, no_output)) { - pfile->cb.enter_file = cb_enter_file; - pfile->cb.leave_file = cb_leave_file; - pfile->cb.rename_file = cb_rename_file; + pfile->cb.ident = cb_ident; + pfile->cb.def_pragma = cb_def_pragma; + if (! CPP_OPTION (pfile, no_line_commands)) + { + pfile->cb.enter_file = cb_enter_file; + pfile->cb.leave_file = cb_leave_file; + pfile->cb.rename_file = cb_rename_file; + } } + if (CPP_OPTION (pfile, dump_includes)) pfile->cb.include = cb_include; + if (CPP_OPTION (pfile, debug_output) || CPP_OPTION (pfile, dump_macros) == dump_names || CPP_OPTION (pfile, dump_macros) == dump_definitions) @@ -105,8 +111,6 @@ main (argc, argv) pfile->cb.undef = cb_undef; pfile->cb.poison = cb_def_pragma; } - pfile->cb.ident = cb_ident; - pfile->cb.def_pragma = cb_def_pragma; /* Register one #pragma which needs special handling. */ cpp_register_pragma(pfile, 0, "implementation", do_pragma_implementation); @@ -271,7 +275,8 @@ do_pragma_implementation (pfile) } /* forward to default-pragma handler. */ - cb_def_pragma (pfile); + if (pfile->cb.def_pragma) + (*pfile->cb.def_pragma) (pfile); } /* Dump out the hash table. */ |