Fix PR 3669

Neil Booth neil@daikokuya.demon.co.uk
Sun Jul 29 07:34:00 GMT 2001


This makes sure we don't output -dM or other info when sending
dependencies to stdout.  I'm not certain I'd call this a bug, but it's
probably not desirable behaviour.

I can't think of how to test this in dejagnu; a way of redirecting
stdout to a file is needed.

Neil.

	PR preprocessor/3669
	* cppinit.c (init_dependency_output): Turn off dump requests
	if sending dependencies to stdout.

Index: cppinit.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cppinit.c,v
retrieving revision 1.163
diff -u -p -r1.163 cppinit.c
--- cppinit.c	2001/07/20 10:30:47	1.163
+++ cppinit.c	2001/07/29 14:30:19
@@ -1765,12 +1765,14 @@ init_dependency_output (pfile)
     }
 
   /* If dependencies go to standard output, or -MG is used, we should
-     suppress output.  The user may be requesting other stuff to
-     stdout, with -dM, -v etc.  We let them shoot themselves in the
-     foot.  */
+     suppress output, including -dM, -dI etc.  */
   if (CPP_OPTION (pfile, deps_file) == 0
       || CPP_OPTION (pfile, print_deps_missing_files))
-    CPP_OPTION (pfile, no_output) = 1;
+    {
+      CPP_OPTION (pfile, no_output) = 1;
+      CPP_OPTION (pfile, dump_macros) = 0;
+      CPP_OPTION (pfile, dump_includes) = 0;
+    }
 }
 
 static void



More information about the Gcc-patches mailing list