https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66932

--- Comment #5 from Michael McWilliam <pilot.mm at gmail dot com> ---
(In reply to Andrew Pinski from comment #4)
> An empty : causes the current directory to be added.

Thanks for explaining that... Including the current directory with an empty :
makes sense (as it is in the documented). However that does not seem to be what
is happening considering this causes ../bfd/ to take precedent over ./. Simply
setting C_INCLUDE_PATH to any of the following will cause the error:

C_INCLUDE_PATH=":"
C_INCLUDE_PATH=":/usr/include/"
C_INCLUDE_PATH="./"
C_INCLUDE_PATH="/usr/include/:"

According to the documentation the -I directives are included first, then those
of C_INCLUDE_PATH, then the system headers. In this problem the local directory
is included first with -I. So it seems that when the compiler sees a directory
in C_INCLUDE_PATH it forgets any duplicates specified with -I and the include
precedence is being broken. Stated simply I think gcc is failing to check if an
include directory is already specified when it adds C_INCLUDE_PATH headers in
lower precedence.

So it seems it is a real bug... and a somewhat obscure bug...

Reply via email to