This is the mail archive of the gcc-help@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 in -iwithprefix?


Hi,

I'm assuming -iprefix + -iwithprefix would locate DIR to same place as
if specified by -idirafter, from below info gcc:

`-iwithprefix DIR'
`-iwithprefixbefore DIR'
     Append DIR to the prefix specified previously with `-iprefix', and
     add the resulting directory to the include search path.
     `-iwithprefixbefore' puts it in the same place `-I' would;
     `-iwithprefix' puts it where `-idirafter' would.


However, it didn't with gcc-4.1.2 (FC7):
(it was same with FC3, gcc-3.4.2)

$ cat test.c 
/* this should be included by system directory's include/err.h */
#include <err.h>

$ cat ./include/err.h 
#error "Choke me"

$ gcc -iprefix ./ -iwithprefix include/ -c test.c 
In file included from test.c:2:
./include/err.h:1:2: error: #error "Choke me"
$ gcc -idirafter ./include/ -c test.c 
$ 

With -idirafter -v, include search path was:
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/lib/gcc/i386-redhat-linux/4.1.2/include
 /usr/include
 ./include/
End of search list.

Whereas -iwitprefix -v, include search path was:
#include "..." search starts here:
#include <...> search starts here:
 ./include/
 /usr/local/include
 /usr/lib/gcc/i386-redhat-linux/4.1.2/include
 /usr/include

So, as opposed to the gcc info, -iwithprefix does not seem to put DIR
where -idirafter would.

Thanks in advance.


Best Regards,

(Hiroki Kaminaga)
t
--


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