CPLUS_INCLUDE_PATH confused by colons

Zack Weinberg zack@codesourcery.com
Mon Mar 25 14:30:00 GMT 2002


On Mon, Mar 25, 2002 at 09:11:59PM +0000, Neil Booth wrote:
> >  
> >  @env{CPATH} specifies a list of directories to be searched as if
> > -specified with @option{-I}, but after any paths given with @option{-I}
> > -options on the command line.  The environment variable is used
> > -regardless of which language is being preprocessed.
> > +specified with @option{-isystem}, hence after any paths given with
> > +@option{-I} options on the command line.  This environment variable is
> > +used regardless of which language is being preprocessed.
> 
> Why have you changed this?  I don't think it's the same as -isystem,
> since they're not flagged as system directories:
> 
>   GET_ENV_PATH_LIST (path, "CPATH");
>   if (path != 0 && *path != 0)
>     path_include (pfile, path, BRACKET);

Argh, have I gotten it backward?  (reads code) Yes.  And I should have
seen that in the very next para C_INCLUDE_PATH and friends are stated
as equivalent to -isystem.

I was thinking of that bug report we got about C_INCLUDE_PATH turning
on implicit extern "C" on Solaris, and misremembered it as CPATH.

> > +In all these variables, an empty element instructs the compiler to
> > +search its current working directory.  Empty elements can appear at the
> > +beginning or end of a path.  For instance, if the value of
> > +@env{C_INCLUDE_PATH} is @code{:/special/include}, that has the same
> > +effect as @samp{@w{-I. -I/special/include}}.
> 
> -isystem. -isystem/special/include no?

@env{CPATH}, rather.  The dot gets lost at the end of -isystem.

Corrected patch:

zw

Index: doc/cppenv.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/cppenv.texi,v
retrieving revision 1.2
diff -u -p -r1.2 cppenv.texi
--- cppenv.texi	2002/03/11 21:11:35	1.2
+++ cppenv.texi	2002/03/25 21:24:58
@@ -25,13 +25,19 @@ semicolon, and for almost all other targ
 
 @env{CPATH} specifies a list of directories to be searched as if
 specified with @option{-I}, but after any paths given with @option{-I}
-options on the command line.  The environment variable is used
+options on the command line.  This environment variable is used
 regardless of which language is being preprocessed.
 
 The remaining environment variables apply only when preprocessing the
 particular language indicated.  Each specifies a list of directories
 to be searched as if specified with @option{-isystem}, but after any
 paths given with @option{-isystem} options on the command line.
+
+In all these variables, an empty element instructs the compiler to
+search its current working directory.  Empty elements can appear at the
+beginning or end of a path.  For instance, if the value of
+@env{CPATH} is @code{:/special/include}, that has the same
+effect as @samp{@w{-I. -I/special/include}}.
 
 @ifset cppmanual
 See also @ref{Search Path}.



More information about the Gcc-bugs mailing list