This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: CPLUS_INCLUDE_PATH confused by colons
- From: Neil Booth <neil at daikokuya dot demon dot co dot uk>
- To: Christoph Bugel <chris at tti-telecom dot com>
- Cc: gcc-bugs at gcc dot gnu dot org, Zack Weinberg <zack at codesourcery dot com>
- Date: Sun, 24 Mar 2002 17:35:14 +0000
- Subject: Re: CPLUS_INCLUDE_PATH confused by colons
- References: <20020324162904.GA10814@pingu.tti>
Christoph Bugel wrote:-
> Most interestingly, I noticed that the bug triggers only
> when the path ends with a semicolon:
>
> CPLUS_INCLUDE_PATH=/usr/lib/qt/include = OK
> CPLUS_INCLUDE_PATH=/usr/lib/qt/include: = BUG
These environment variables are a colon-separated list of
paths. So you effectively have an empty-path here, which
is being treated as the current directory. This is a
deliberate feature; whether it's a good idea I'm not
sure. This is the relevant code from cppinit.c:
if (q == p)
{
/* An empty name in the path stands for the current
directory. */
name = (char *) xmalloc (2);
name[0] = '.';
name[1] = 0;
}
Zack?
Neil.