Email List: Xaustin-group-lX
[All Lists]

RE: question about headers

To: "'Garrett Wollman'" <yyyyyyy@xxxxxxxxxxx>, yyyyyyyyyyyyyy@xxxxxxxxxxxxx
Subject: RE: question about headers
From: Schwarz Konrad <yyyyyyyyyyyyyy@xxxxxxxxxxx>
Date: Thu, 8 May 2003 09:12:54 +0200
Cc: yyyyyyyyyyyyyy@xxxxxxxxxxxxx
Garret Wollman on inclusion of non-standard headers by standard headers:

FWIW, in FreeBSD we normally put headers like this in `sys/' or `machine/'
-- I don't see on a quick inspection any examples of a Standard header
included a non-standard header which was located at the top level of
/usr/include.

My reply:

It's not worth a lot, because sys/ or machine/ are not reserved by any
standard either, to my knowledge; David Korn could also have had an
include/sys or include/machine directory in addition to his include/
directory.

I consider the system on which Korn's application failed to be in error.
The <stdio.h> header should have used # include "..." instead of # include
<...>.  All compilers I am familiar with will then first attempt to include
a file relative to the location of the including file, <stdio.h> in this
case.  That would have prevented the problem.

Unfortunately, I do not currently have access to the C standard text,
otherwise I could check if this behavior is mandated.

The disadvantage of this solution is that one cannot cause standard headers
to include a different header from the one it normally includes by adding -I
switches (e.g. for debugging or other special purposes) but this can be
achieved by other means; e.g. by using a modified copy of the include
hierarchy, by conditionally including headers, or, perhaps, by using macro
expanded include directives.  In any case, this application should have far
less weight than the problem of imposing on the user's header file
namespace.

Regards,
Konrad

<Prev in Thread] Current Thread [Next in Thread>