Resolving libc #includes
Earl Chew
earl_chew@agilent.com
Tue Nov 16 20:51:00 GMT 2004
James Antill wrote:
> Earl Chew <earl_chew@agilent.com> writes:
> Use gcc -I application/includes -I- -c foo.c
>
>>and I happen to have a file named application/includes/features.h.
>
> Then it won't be picked up with #include <features.h> only
> with #include "features.h"
I was going to respond with a scenario showing how -I- causes
problems of its own, but I see that gcc is already moving
towards a solution. See Mike Stump's posting here:
http://gcc.gnu.org/ml/gcc-patches/2004-04/msg02027.html
and follow the ensuing discussion thread here:
http://gcc.gnu.org/ml/gcc-patches/2004-05/msg00114.html
Using #include <> to locate system headers, and -iquote to
restrict #include "" look in the directory containing the
current file, then to non-system header locations appears
to be the best way forward.
Earl
More information about the Libc-alpha
mailing list