This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[CPP] -M vs -include
- From: Richard Henderson <rth at redhat dot com>
- To: neil at daikokuya dot co dot uk, gcc-patches at gcc dot gnu dot org
- Cc: Roland McGrath <roland at redhat dot com>
- Date: Sat, 2 Nov 2002 14:24:00 -0800
- Subject: [CPP] -M vs -include
The following test case:
% echo > x.h
% echo > z.h
% echo '#include "z.h"' > z.c
% gcc -M -include x.h z.c
produced
z.o: z.c x.h
instead of the expected
z.o: z.c x.h z.h
This caused the dependencies created by glibc to be wrong, which
leads to extremely irritating non-recompilation errors.
The following patch appears to cure the problem. Neil, can you
comment on why you added this in the first place?
r~
* cppmacro.c (cpp_scan_nooutput): Do not set return_at_eof.
Index: cppmacro.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cppmacro.c,v
retrieving revision 1.126
diff -c -p -d -u -r1.126 cppmacro.c
--- cppmacro.c 9 Oct 2002 09:56:07 -0000 1.126
+++ cppmacro.c 2 Nov 2002 22:16:23 -0000
@@ -1198,10 +1198,6 @@ void
cpp_scan_nooutput (pfile)
cpp_reader *pfile;
{
- /* Request a CPP_EOF token at the end of this file, rather than
- transparently continuing with the including file. */
- pfile->buffer->return_at_eof = true;
-
if (CPP_OPTION (pfile, traditional))
while (_cpp_read_logical_line_trad (pfile))
;