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]

[Bug preprocessor/13498] New: CPP include search path documentation is incorrect


The Search Path node of the CPP docs says:

On a normal Unix system, if you do not instruct it otherwise, it will look for headers requested with 
#include?<file> in:
     /usr/local/include
     /usr/lib/gcc-lib/TARGET/VERSION/include
     /usr/TARGET/include
     /usr/include

This is incorrect AFAICT.  The default search path on my system (as seen from gcc -v ...) is:
     /usr/local/include
     GCC_EXEC_PREFIX/include
     GCC_EXEC_PREFIX/gcc-lib/TARGET/VERSION/include
     GCC_EXEC_PREFIX/TARGET/include
     /usr/include

I didn't pass any special options to configure (eg --with-local-prefix), and the path doesn't seem 
to come from a specs file, so I'm guessing this is the hardcoded default.  To be absolutely clear, 
the two errors I see are the missing GCC_EXEC_PREFIX/include (2nd dir in path), and the doc 
simply says "/usr" when actually it's GCC_EXEC_PREFIX.  (I'm using GCC_EXEC_PREFIX as shorthand 
for the --exec-prefix arg I passed to configure.)

On a system where GCC_EXEC_PREFIX = /usr, the docs are correct, however that is a specific 
configuration; for the general case the docs are in error (apparently).  It's especially worth noting 
that the /usr/include dir is always last even if, by the rules for the general case, it would be 2nd.

Ultimately, I guess it comes down to, what is a "normal unix system"?  Given that /usr/local is the 
default prefix, I think the docs should be updated.

-- 
           Summary: CPP include search path documentation is incorrect
           Product: gcc
           Version: 3.3.2
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: preprocessor
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: fcusack at fcusack dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: sparc-sun-solaris2.9
  GCC host triplet: sparc-sun-solaris2.9
GCC target triplet: sparc-sun-solaris2.9


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13498


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