Re: Adding include directories (-I)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sebastian Biallas <sb@xxxxxxxxxxx> writes:

> [The line 11 of unistd.h reads #include <process.h>]

If that said #include "process.h" instead, then it would always
include the file named process.h in the same directory.

> So, the -I. option adds '.' to the list of system header directories.
> That means if I have a file which accidently has some "forbidden" name
> which is used somewhere deep in the system headers, everything breaks.

Yes.

> > If you want to do something more complex, see the documentation for
> > -iquote and -isystem.  They probably don't do what you want, but they
> > may be instructive.
> 
> -iquote is what I want, but:
> 
> It changed syntax recently (was -I- before). So it's not (easily)
> possible to write a simple makefile for use with gcc3 and gcc4. And
> automake adds -I. by default.

Hmmmm, that's true about automake.  It does that so that #include
"foo.h" can pick up a file from the object directory as well as from
the source directory.

Note that -I- still exists.  -iquote is different.  But you're right
that to write a Makefile which works with both gcc3 and gcc4 you will
need an autoconf test.

I don't see any good solutions here.  Except, perhaps, renaming your
header file.

Ian

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux