Resolving libc #includes

Earl Chew earl_chew@agilent.com
Mon Nov 15 22:26:00 GMT 2004


Roland McGrath wrote:
> If you are using -I options you are getting what you asked for.
> If not, that's why #include <...> or different from #include "...".

Say I use:

	% cat foo.c
	...
	#include <stdio.h>
	...

	% gcc -I application/includes -c foo.c

and I happen to have a file named application/includes/features.h.

If I understand you correctly, you're saying that it's expected
behaviour when an error results as the application uses
#include <stdio.h> to use stdio from libc, and the compile fails
because the compiler feeds application/include/features.h to libc.

I think you're tell me that the application should:

a. Rename application/includes/features.h to something else that
    doesn't collide with the library, or

b. Not use -I in the compiler invocation.

I do not believe there is anything in the standard precluding
an application from naming an application header features.h,
and I also do not know of any rule an application can follow
to stay clear of potential file naming conflicts with libc.

I think abstaining from -I a little impractical.

Earl



More information about the Libc-alpha mailing list