Quotes and Brackets In Include Directives
Zack Weinberg
zack@codesourcery.com
Tue Sep 4 13:00:00 GMT 2001
On Tue, Sep 04, 2001 at 02:49:07PM -0500, Robert Boehne wrote:
> Eric Lemings wrote:
> >
> > I always thought that:
> >
> > #include <string.h>
> >
> > would include the string.h header in the "system" include path while:
> >
> > #include "string.h"
> >
> > would include a different string.h header file in the "local" include
> > path.
Yes; however, with one key exception, those paths are identical.
Please see the manual for GNU CPP, which describes in great detail how
GCC searches for include files.
> > This doesn't seem to be the case in gcc-3.0.1 at least. The first form
> > is including the local version rather than the system version of the
> > string.h header. This never happened before 3.0.1. Is this new
> > behavior? How do I distinguish the two header files?
I cannot answer this question unless you tell me exactly how your
build tree is laid out, and the exact command line GCC is being
invoked with. Please see if the manual clarifies the situation first.
> GCC fixes all of the system's include files and puts them
> in its own directories, so you wouldn't have any "system"
> headers at all.
I'm sorry, you're severely confused. GCC does make corrections to a
few of the system's include files when it is installed. We try to do
as little of this as possible. (Older versions of GCC, installed on
older systems with buggier headers, had to do more fixing.) However,
the special directory where the fixed headers are kept still counts as
a "system" include directory, in all the places where that matters.
zw
More information about the Gcc
mailing list