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]
Other format: [Raw text]

Re: [CPP] -M vs -include


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.


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