aboutsummaryrefslogtreecommitdiff
path: root/gcc/cppinit.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2002-05-01 22:07:36 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2002-05-01 22:07:36 +0200
commit1651cc96a4bbe8c470fe913e4aa5538dd12631fa (patch)
tree0af5394fa69c6cca7279895bd44508f64bc4cb41 /gcc/cppinit.c
parent8998d5bf4066a74600aa0abd1f8a6275d29b3b64 (diff)
downloadgcc-1651cc96a4bbe8c470fe913e4aa5538dd12631fa.zip
gcc-1651cc96a4bbe8c470fe913e4aa5538dd12631fa.tar.gz
gcc-1651cc96a4bbe8c470fe913e4aa5538dd12631fa.tar.bz2
cppinit.c (cpp_handle_option): Don't set no_output here...
* cppinit.c (cpp_handle_option) [-dM]: Don't set no_output here... (cpp_post_options): ...but here. Disable -dD, -dN and -dI when -M -or -MM is in effect. From-SVN: r53013
Diffstat (limited to 'gcc/cppinit.c')
-rw-r--r--gcc/cppinit.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/gcc/cppinit.c b/gcc/cppinit.c
index c4f5942..cee7571 100644
--- a/gcc/cppinit.c
+++ b/gcc/cppinit.c
@@ -1549,7 +1549,6 @@ cpp_handle_option (pfile, argc, argv, ignore)
{
case 'M':
CPP_OPTION (pfile, dump_macros) = dump_only;
- CPP_OPTION (pfile, no_output) = 1;
break;
case 'N':
CPP_OPTION (pfile, dump_macros) = dump_names;
@@ -1820,6 +1819,21 @@ cpp_post_options (pfile)
if (CPP_OPTION (pfile, preprocessed))
pfile->state.prevent_expansion = 1;
+ /* -dM makes no normal output. This is set here so that -dM -dD
+ works as expected. */
+ if (CPP_OPTION (pfile, dump_macros) == dump_only)
+ CPP_OPTION (pfile, no_output) = 1;
+
+ /* Disable -dD, -dN and -dI if we should make no normal output
+ (such as with -M). Allow -M -dM since some software relies on
+ this. */
+ if (CPP_OPTION (pfile, no_output))
+ {
+ if (CPP_OPTION (pfile, dump_macros) != dump_only)
+ CPP_OPTION (pfile, dump_macros) = dump_none;
+ CPP_OPTION (pfile, dump_includes) = 0;
+ }
+
/* We need to do this after option processing and before
cpp_start_read, as cppmain.c relies on the options->no_output to
set its callbacks correctly before calling cpp_start_read. */