This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [RFC] libstdc++/6720 and libstdc++/6671
On May 23, 2002, Zack Weinberg <zack@codesourcery.com> wrote:
>> Then, -I flags won't get bits/bar.h accidentally replaced, but
>> -isystem will still allow users to do it if they really mean it.
> I could get behind this. It's a straightforward change and easy to
> document.
> Here's a challenge: does this idea get rid of the need for "quoted
> includes" in fixincludes? If not, can you make it do so?
I'm not familiar with this problem. From the rest of your message, it
appears to me that the problem is that there are system headers in
directory say dir that use `#include "whatever"' such that
dir/whatever does not exist.
Assuming this is the problem, perhaps we could arrange for *all*
#include directives in system headers to search system-header
directories before user-header directories. I.e., not make `#include
<header>' behave differently from `#include "header"' when found in a
system header, except that `#include "header"' would search for
dir/header before searching other system headers. How's that?
> Here's a second: What should double-quote includes do in system
> headers?
IMO, double-quotes should always search starting from the directory in
which the file being processed is.
> Can you make this work so that -I- doesn't break system headers?
It appears to me that getting -I- to not affect the search for
dir/whatever when dir/header that includes it with double quotes is a
system header.
>> It seems to me that the
>> only way to overcome this problem is to have the preprocessor know a
>> list of standard headers, that, when included with angle brackets, it
>> would search in -I directories, but warn instead of including them.
> I am opposed to any change involving wiring a list of headers into the
> preprocessor, because it would only raise a debate about which headers
> should be on the list
There's no debate about this. I'm talking about the headers specified
in the standards, the only headers for which the standards specify
some special behavior. It can't possibly change from one OS to
another.
But I agree these shouldn't be hardwired into the preprocessor; the
language front-end should provide the preprocessor with such a list.
> with the "correct" answer varying with both the standards of
> interest and the operating system in use.
I'm only concerned about the ISO standards for C and C++ (perhaps with
the set of headers varying depending on the particular version of
these languages in use). Do you have any other standards in mind? Do
any such other standards impose special behavior upon the compiler,
like the C and C++ standards do?
--
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 Professional serial bug killer