This may be me being stupid, but I don't understand the whole -I vs -iquote thing. If I just use -I, and then a commandline like:
gcc -v -I/tmp/home-alexms-epage-generated/linux/x86/gcc/include -I/home/alexms/epage/platform/linux/x86/gcc/include -I/home/alexms/epage/platform/linux/x86/include -I/home/alexms/epage/platform/linux/include -I/home/alexms/epage/include -I/home/alexms/epage/libraries/ole/include -o api.o api.c with libraries/ole/include containing a file called endian.h, I get: #include "..." search starts here: #include <...> search starts here: /tmp/home-alexms-epage-generated/linux/x86/gcc/include /home/alexms/epage/platform/linux/x86/gcc/include /home/alexms/epage/platform/linux/x86/include /home/alexms/epage/platform/linux/include /home/alexms/epage/include /home/alexms/epage/libraries/ole/include /usr/local/include /usr/lib/gcc/i486-linux-gnu/4.1.2/include /usr/include In file included from /usr/include/stdlib.h:43, from /home/alexms/epage/platform/linux/include/pal/pal-stdlib.h:18, from /home/alexms/epage/platform/linux/include/pal/crt.h:23, from /home/alexms/epage/include/epage/ustring.h:23, from /home/alexms/epage/include/epage/error.h:40, from /home/alexms/epage/libraries/ole/api.c:18: /usr/include/bits/waitstatus.h:80: error: duplicate member '__w_retcode' /usr/include/bits/waitstatus.h:80: error: duplicate member '({anonymous})' /usr/include/bits/waitstatus.h:80: error: duplicate member '({anonymous})' /usr/include/bits/waitstatus.h:81: error: duplicate member '__w_coredump' /usr/include/bits/waitstatus.h:81: error: duplicate member '({anonymous})' /usr/include/bits/waitstatus.h:81: error: duplicate member '({anonymous})' /usr/include/bits/waitstatus.h:81: error: duplicate member '({anonymous})' /usr/include/bits/waitstatus.h:82: error: duplicate member '__w_termsig' /usr/include/bits/waitstatus.h:82: error: duplicate member '({anonymous})' /usr/include/bits/waitstatus.h:82: error: duplicate member '({anonymous})' /usr/include/bits/waitstatus.h:82: error: duplicate member '({anonymous})' /usr/include/bits/waitstatus.h:82: error: duplicate member '({anonymous})' /usr/include/bits/waitstatus.h:94: error: duplicate member '__w_stopsig' /usr/include/bits/waitstatus.h:94: error: duplicate member '({anonymous})' /usr/include/bits/waitstatus.h:94: error: duplicate member '({anonymous})' /usr/include/bits/waitstatus.h:95: error: duplicate member '__w_stopval' /usr/include/bits/waitstatus.h:95: error: duplicate member '({anonymous})' /usr/include/bits/waitstatus.h:95: error: duplicate member '({anonymous})' /usr/include/bits/waitstatus.h:95: error: duplicate member '({anonymous})' Because the endian.h in libraries/ole/include overrides the system one. I thought the whole point of -I was to be the "..." headers, and you used -j for the system headers, so why are my -I headers being coerced into being bracketed headers? Obviously with -I-, this worked fine as all the -I headers remained as quoted ones, and the /usr/include etc. headers were bracketed, so <endian.h> got picked up correctly. So this seems broken to me, you shouldn't need to go through and replace all your -I's with -iquote's, purely to give -I a behaviour it was supposed to have in the first place, and use -j for system headers? -- Summary: Broken -I- vs -iquote behaviour Product: gcc Version: 4.1.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: archifishal at gmx dot co dot uk http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33898