public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug preprocessor/31186]  New: -I/usr/include not taken into account
@ 2007-03-15 14:22 vincent at vinc17 dot org
  2007-03-15 15:48 ` [Bug preprocessor/31186] " pinskia at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: vincent at vinc17 dot org @ 2007-03-15 14:22 UTC (permalink / raw)
  To: gcc-bugs

When C_INCLUDE_PATH is defined and -I/usr/include is used, /usr/include should
have the precedence, but examples show that it is not taken into account.

vin:~> cat test.c
#include <mpfr.h>
vin:~> C_INCLUDE_PATH=/home/vlefevre/include gcc -E -I/usr/include test.c |
grep mpfr.h
# 1 "/home/vlefevre/include/mpfr.h" 1 3
[...]
vin:~> gcc -E -I/usr/include test.c | grep mpfr.h
# 1 "/usr/include/mpfr.h" 1 3 4
[...]
vin:~> C_INCLUDE_PATH=/home/vlefevre/include gcc -E
-I/usr/milip-local/stow/mpfr-2.2.0/mpfr/include test.c | grep mpfr.h
# 1 "/usr/milip-local/stow/mpfr-2.2.0/mpfr/include/mpfr.h" 1
[...]

The gcc man page says:

       -isystem dir
           Search dir for header files, after all directories specified
           by -I but before the standard system directories.  Mark it
           as a system directory, so that it gets the same special
           treatment as is applied to the standard system directories.

so that in the first case, the search path should be:

  /usr/include /home/vlefevre/include /usr/include

equivalent to:

  /usr/include /home/vlefevre/include

Note: this introduces an inconsistency when both -I/usr/include and -L/usr/lib
are used, since the header file is taken from C_INCLUDE_PATH and the library
file is taken from /usr/lib.


-- 
           Summary: -I/usr/include not taken into account
           Product: gcc
           Version: 4.1.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: preprocessor
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: vincent at vinc17 dot org


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-08-28 10:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-31186-4@http.gcc.gnu.org/bugzilla/>
2021-08-28  3:45 ` [Bug preprocessor/31186] -I/usr/include not taken into account pinskia at gcc dot gnu.org
2021-08-28 10:37 ` vincent-gcc at vinc17 dot net
2007-03-15 14:22 [Bug preprocessor/31186] New: " vincent at vinc17 dot org
2007-03-15 15:48 ` [Bug preprocessor/31186] " pinskia at gcc dot gnu dot org
2007-03-15 16:51 ` vincent at vinc17 dot org
2007-05-22 18:11 ` tromey at gcc dot gnu dot org
2007-05-22 21:51 ` vincent at vinc17 dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).