This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [CPP] -M vs -include
- From: Neil Booth <neil at daikokuya dot co dot uk>
- To: Richard Henderson <rth at redhat dot com>, gcc-patches at gcc dot gnu dot org,Roland McGrath <roland at redhat dot com>
- Date: Thu, 7 Nov 2002 08:01:30 +0000
- Subject: Re: [CPP] -M vs -include
- References: <20021102142400.A2249@redhat.com>
Richard Henderson wrote:-
> 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?
> - /* 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;
> -
At a glance, I don't *think* this is the bug; that is needed so we
only scan a single file.
I'll take a look in the next 24 hours.
Neil.