Commit ba57a9c0 by Neil Booth Committed by Neil Booth

cppinit.c (cpp_handle_option): Suppress warnings with an implicit "-w" for "-M" and "-MM".

	* cppinit.c (cpp_handle_option):  Suppress warnings with an
	implicit "-w" for "-M" and "-MM".

From-SVN: r55195
parent b6fb43ab
...@@ -29,6 +29,7 @@ Tue Jul 2 18:45:45 2002 J"orn Rennecke <joern.rennecke@superh.com> ...@@ -29,6 +29,7 @@ Tue Jul 2 18:45:45 2002 J"orn Rennecke <joern.rennecke@superh.com>
2002-07-02 Neil Booth <neil@daikokuya.co.uk> 2002-07-02 Neil Booth <neil@daikokuya.co.uk>
PR preprocessor/7029
* cppinit.c (cpp_handle_option): Suppress warnings with an * cppinit.c (cpp_handle_option): Suppress warnings with an
implicit "-w" for "-M" and "-MM". implicit "-w" for "-M" and "-MM".
* doc/cppopts.texi: Update. * doc/cppopts.texi: Update.
......
...@@ -1532,10 +1532,12 @@ cpp_handle_option (pfile, argc, argv) ...@@ -1532,10 +1532,12 @@ cpp_handle_option (pfile, argc, argv)
or environment var dependency generation is used. */ or environment var dependency generation is used. */
CPP_OPTION (pfile, print_deps) = 2; CPP_OPTION (pfile, print_deps) = 2;
CPP_OPTION (pfile, no_output) = 1; CPP_OPTION (pfile, no_output) = 1;
CPP_OPTION (pfile, inhibit_warnings) = 1;
break; break;
case OPT_MM: case OPT_MM:
CPP_OPTION (pfile, print_deps) = 1; CPP_OPTION (pfile, print_deps) = 1;
CPP_OPTION (pfile, no_output) = 1; CPP_OPTION (pfile, no_output) = 1;
CPP_OPTION (pfile, inhibit_warnings) = 1;
break; break;
case OPT_MF: case OPT_MF:
CPP_OPTION (pfile, deps_file) = arg; CPP_OPTION (pfile, deps_file) = arg;
...@@ -1794,14 +1796,13 @@ cpp_post_options (pfile) ...@@ -1794,14 +1796,13 @@ cpp_post_options (pfile)
if (CPP_OPTION (pfile, traditional)) if (CPP_OPTION (pfile, traditional))
CPP_OPTION (pfile, show_column) = 0; CPP_OPTION (pfile, show_column) = 0;
/* -dM makes no normal output. This is set here so that -dM -dD /* -dM and dependencies suppress normal output; do it here so that
works as expected. */ the last -d[MDN] switch overrides earlier ones. */
if (CPP_OPTION (pfile, dump_macros) == dump_only) if (CPP_OPTION (pfile, dump_macros) == dump_only)
CPP_OPTION (pfile, no_output) = 1; CPP_OPTION (pfile, no_output) = 1;
/* Disable -dD, -dN and -dI if we should make no normal output /* Disable -dD, -dN and -dI if normal output is suppressed. Allow
(such as with -M). Allow -M -dM since some software relies on -dM since at least glibc relies on -M -dM to work. */
this. */
if (CPP_OPTION (pfile, no_output)) if (CPP_OPTION (pfile, no_output))
{ {
if (CPP_OPTION (pfile, dump_macros) != dump_only) if (CPP_OPTION (pfile, dump_macros) != dump_only)
...@@ -1809,17 +1810,16 @@ cpp_post_options (pfile) ...@@ -1809,17 +1810,16 @@ cpp_post_options (pfile)
CPP_OPTION (pfile, dump_includes) = 0; CPP_OPTION (pfile, dump_includes) = 0;
} }
/* We need to do this after option processing and before /* Intialize, and check environment variables for, dependency
cpp_start_read, as cppmain.c relies on the options->no_output to output. */
set its callbacks correctly before calling cpp_start_read. */
init_dependency_output (pfile); init_dependency_output (pfile);
/* After checking the environment variables, check if -M or -MM has /* If we're not outputting dependencies, complain if other -M
not been specified, but other -M options have. */ options have been given. */
if (CPP_OPTION (pfile, print_deps) == 0 && if (!CPP_OPTION (pfile, print_deps)
(CPP_OPTION (pfile, print_deps_missing_files) && (CPP_OPTION (pfile, print_deps_missing_files)
|| CPP_OPTION (pfile, deps_file) || CPP_OPTION (pfile, deps_file)
|| CPP_OPTION (pfile, deps_phony_targets))) || CPP_OPTION (pfile, deps_phony_targets)))
cpp_error (pfile, DL_ERROR, cpp_error (pfile, DL_ERROR,
"you must additionally specify either -M or -MM"); "you must additionally specify either -M or -MM");
} }
......
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