preprocessor/6521: -MG creates dependency with wrong path
Zack Weinberg
zack@codesourcery.com
Fri May 3 09:46:00 GMT 2002
On Fri, May 03, 2002 at 01:54:10PM +0100, Neil Booth wrote:
> rspier@pobox.com wrote:-
>
> > >Description:
> > gcc or g++ -MG outputs incorrect dependency information when there is a nonexistent header file specified in angle brackets. (i.e. #include <...>)
> >
> > It uses the path of the first specified -I argument (or the first system directory, if no directory is specified.)
> >
> > The attached script demonstrates the problem.
> >
> > #include "some/header.h"
> > #include <nonexistent.h>
> > int main() {
> > }
> > gcc3 -M -MG /tmp/_16336//test.c -I/tmp/_16336//not/a/real/path
> > test.o: /tmp/_16336/test.c some/header.h \
> > /tmp/_16336/not/a/real/path/nonexistent.h
> > >How-To-Repeat:
> > (Run attached script.)
>
> This is intended behaviour (but undocumented I think); whether it is
> desirable or not is a different question.
>
> IMO this is not worth fixing; and we should just document the behaviour
> for <> headers. What do you think, Zack?
Agreed.
zw
More information about the Gcc-bugs
mailing list