This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: A patch for gcc -M.


On Mon, Jul 17, 2000 at 01:12:42PM -0700, H . J . Lu wrote:
> 
> Here is a patch for gcc -M.
> 
> H.J.
> --
> 2000-07-17  H.J. Lu  (hjl@gnu.org)
> 
> 	* cppfiles.c (read_include_file): Output token only if
> 	CPP_OPTION (pfile, no_output) is zero.
> 	* cppinit.c (cpp_finish): Likewise.
> 	* cpplib.c (pass_thru_directive): Likewise.

You're working way too hard.  Try this patch instead.

The *right* patch involves getting rid of pfile->printer, which was
never supposed to exist in the first place, but we're not quite ready
to do that yet.

zw

	* cppmain.c: Do not set pfile->printer if no_output is on.

===================================================================
Index: cppmain.c
--- cppmain.c	2000/07/04 01:58:20	1.28
+++ cppmain.c	2000/07/17 20:27:20
@@ -68,7 +68,8 @@ main (argc, argv)
   print = cpp_printer_init (pfile, &parse_out);
   if (! print)
     return (FATAL_EXIT_CODE);
-  pfile->printer = print;
+  if (! CPP_OPTION (pfile, no_output))
+    pfile->printer = print;
 
   if (! cpp_start_read (pfile, print, CPP_OPTION (pfile, in_fname)))
     return (FATAL_EXIT_CODE);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]