This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: A patch for gcc -M.
- To: "H . J . Lu" <hjl at valinux dot com>
- Subject: Re: A patch for gcc -M.
- From: Zack Weinberg <zack at wolery dot cumb dot org>
- Date: Mon, 17 Jul 2000 13:30:47 -0700
- Cc: gcc-patches at gcc dot gnu dot org
- References: <20000717131242.A3862@valinux.com>
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);