This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: libstdc++ headers and system headers
- To: Joe Buck <jbuck at synopsys dot COM>
- Subject: Re: libstdc++ headers and system headers
- From: Alexandre Oliva <aoliva at redhat dot com>
- Date: 16 Feb 2001 17:15:24 -0200
- Cc: bkoz at redhat dot com (Benjamin Kosnik), neil at daikokuya dot demon dot co dot uk (Neil Booth), gcc at gcc dot gnu dot org, libstdc++ at gcc dot gnu dot org, jason at redhat dot com (Jason Merrill)
- Organization: GCC Team, Red Hat
- References: <200102161849.KAA17763@toledo.synopsys.com>
On Feb 16, 2001, Joe Buck <jbuck@synopsys.COM> wrote:
> Alexandre Oliva writes:
>> In fact, IMO, it's *wrong* to add system header directories with -I.
>> You should use -isystem for those.
> This statement will be seen as strange by anyone who must use more than
> one compiler.
A system header, by definition, is one that is searched by the
compiler by default. You should never have to -I it, and it's always
been the case that -I/usr/include would just break GCC on many
platforms. include/g++-v3 is no different.
> -isystem is gcc-specific, while -I is mostly portable.
This is just because most other compilers don't offer any way for the
user to override their internal notions of what the system headers are
located. GCC does.
> Now, if the only effect of using -I for system headers is, say, you don't
> get the pragma that disables warnings, that's probably OK. But if more
> severe breakage occurs, it will probably be seen as a bug (sorry Robert,
> I used that word again!).
-I/usr/include will, for example, cause an inappropriate varargs.h to
be found by GCC. And that's just the beginning. Potentially, many
other things will break. It's just wrong to use -I/usr/include; the
GCC manual has warned about this for ages, and contains a complete
explanation of the problem.
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me