This is a sample of build command and its verbose output with GCC 4.0.0. There is -I/home/4/wilx/include on the command line. Notice the ordering of include paths int its output: wilx@logout:::~/tmp/gcc-head/objdir/gcc> gcc -v -c -g -DENABLE_CHECKING -DENABLE_ASSERT_CHECKING -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wno-variadic-macros -Wold-style-definition -fno-common -DHAVE_CONFIG_H -I/home/4/wilx/include -I. -I. -I../../srcdir/gcc -I../../srcdir/gcc/. -I../../srcdir/gcc/../include -I../../srcdir/gcc/../libcpp/include ../../srcdir/gcc/expr.c -o expr.o Reading specs from /home/4/wilx/lib/gcc/i386-unknown-freebsd4.10/4.0.0/specs Configured with: ../srcdir/configure --disable-nls --enable-version-specific-runtime-libs --enable-dwarf2 --with-cpu=pentium3 --with-arch=pentium3 --with-system-zlib --disable-shared --prefix=/home/4/wilx --enable-languages=c,c++,objc --disable-sjlj-exceptions --enable-shared=libstdc++ --enable-shared=libobjc --with-gc=zone Thread model: posix gcc version 4.0.0 20041016 (experimental) /home/4/wilx/libexec/gcc/i386-unknown-freebsd4.10/4.0.0/cc1 -quiet -v -I/home/4/wilx/include -I. -I. -I../../srcdir/gcc -I../../srcdir/gcc/. -I../../srcdir/gcc/../include -I../../srcdir/gcc/../libcpp/include -DENABLE_CHECKING -DENABLE_ASSERT_CHECKING -DIN_GCC -DHAVE_CONFIG_H ../../srcdir/gcc/expr.c -quiet -dumpbase expr.c -march=pentium3 -auxbase-strip expr.o -g -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wno-variadic-macros -Wold-style-definition -version -fno-common -o /var/tmp//ccbNklGP.s ignoring nonexistent directory "/home/4/wilx/lib/gcc/i386-unknown-freebsd4.10/4.0.0/../../../../i386-unknown-freebsd4.10/include" ignoring duplicate directory "/home/4/wilx/include" as it is a non-system directory that duplicates a system directory ignoring duplicate directory "." ignoring duplicate directory "../../srcdir/gcc/." #include "..." search starts here: #include <...> search starts here: . ../../srcdir/gcc ../../srcdir/gcc/../include ../../srcdir/gcc/../libcpp/include /usr/local/include /home/4/wilx/include /home/4/wilx/lib/gcc/i386-unknown-freebsd4.10/4.0.0/include /usr/include End of search list. GNU C version 4.0.0 20041016 (experimental) (i386-unknown-freebsd4.10) compiled by GNU C version 4.0.0 20041016 (experimental). GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096 as -o expr.o /var/tmp//ccbNklGP.s Now please observe GCC 2.8.1's behaviour. Notice the include paths ordering this time too. Same environment just different bootstrap compiler. wilx@logout:::~/tmp/gcc-head/objdir/gcc> adagcc -v -c -g -DENABLE_CHECKING -DENABLE_ASSERT_CHECKING -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -fno-common -Wno-error -DHAVE_CONFIG_H -I/home/4/wilx/include -I. -I. -I../../srcdir/gcc -I../../srcdir/gcc/. -I../../srcdir/gcc/../include -I../../srcdir/gcc/../libcpp/include c-parse.c -o c-parse.o Reading specs from /usr/local/lib/gcc-lib/i386-unknown-freebsd4.10/2.8.1/specs gcc version 2.8.1 /usr/local/lib/gcc-lib/i386-unknown-freebsd4.10/2.8.1/cpp -lang-c -v -I/home/4/wilx/include -I. -I. -I../../srcdir/gcc -I../../srcdir/gcc/. -I../../srcdir/gcc/../include -I../../srcdir/gcc/../libcpp/include -undef -D__GNUC__=2 -D__GNUC_MINOR__=8 -Di386 -Dunix -D__ELF__ -D__FreeBSD__=4 -D__i386__ -D__unix__ -D__ELF__ -D__FreeBSD__=4 -D__i386 -D__unix -Asystem(FreeBSD) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386) -g -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wno-error -Di386 -Asystem(unix) -Acpu(i386) -Amachine(i386) -D__i386__ -Asystem(unix) -Acpu(i386) -Amachine(i386) -DENABLE_CHECKING -DENABLE_ASSERT_CHECKING -DIN_GCC -DHAVE_CONFIG_H c-parse.c /tmp/cczdxxvj.i GNU CPP version 2.8.1 (i386 FreeBSD/ELF) #include "..." search starts here: #include <...> search starts here: /home/4/wilx/include . ../../srcdir/gcc ../../srcdir/gcc/../include ../../srcdir/gcc/../libcpp/include /usr/local/include /usr/local/i386-unknown-freebsd4.10/include /usr/local/lib/gcc-lib/i386-unknown-freebsd4.10/2.8.1/include /usr/include End of search list. In file included from ../../srcdir/gcc/../libcpp/include/cpplib.h:29, from c-parse.y:42: /home/4/wilx/include/config.h:1: #error "config.h in ~/include!!!" This time /home/4/wilx/include has made it to the first include path that is searched. For better illustration I have changed the original ~/include/config.h that has been installed by INN with my own one: wilx@logout:::~/tmp/gcc-head/objdir/gcc> cat ~/include/config.h #error "config.h in ~/include!!!"
Not a bug, since /home/4/wilx is a prefix , /home/4/wilx/include is always included after the user includes even though you aupply it on the command line. The bug was 2.8.x which cannot be changed and is so old nobody cares about it.