This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
Re: preprocessor/6521: -MG creates dependency with wrong path
- From: Neil Booth <neil at daikokuya dot demon dot co dot uk>
- To: nobody at gcc dot gnu dot org
- Cc: gcc-prs at gcc dot gnu dot org,
- Date: 3 May 2002 12:56:04 -0000
- Subject: Re: preprocessor/6521: -MG creates dependency with wrong path
- Reply-to: Neil Booth <neil at daikokuya dot demon dot co dot uk>
The following reply was made to PR preprocessor/6521; it has been noted by GNATS.
From: Neil Booth <neil@daikokuya.demon.co.uk>
To: rspier@pobox.com
Cc: gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org,
Zack Weinberg <zack@codesourcery.com>
Subject: Re: preprocessor/6521: -MG creates dependency with wrong path
Date: Fri, 3 May 2002 13:54:10 +0100
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?
Neil.