This is the mail archive of the gcc-bugs@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: preprocessor/6521: -MG creates dependency with wrong path


Robert Spier wrote:-

> The only sensible patch I can think of is to remove this odd
> functionality entirely.
> 
> The below patch unifies handling for system and non-system include
> files and removes the special case.  It only affects -MG, and brings
> it in line with the documentation:
> 
>       -MG When used with -M or -MM, -MG says to treat missing
>            header files as generated files and assume they live
>            in the same directory as the source file.  It sup?
>            presses preprocessed output, as a missing header file
>            is ordinarily an error.

On further reflection, I don't think this makes any sense.
Files included with <> do not search the current directory,
so assuming the file lies there is obviously bogus.

The sensible thing to do, IMO, is to step down the <> include
path until the resulting path, when appending the file name,
exists, and to fail if all such paths don't exist.

Neil.


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