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

question about headers

To: David Korn <yyy@xxxxxxxxxxxxxxxx>
Subject: question about headers
From: Garrett Wollman <yyyyyyy@xxxxxxxxxxx>
Date: Wed, 7 May 2003 21:54:42 -0400 (EDT)
Cc: yyyyyyyyyyyyyy@xxxxxxxxxxxxx
References: <200305080118.VAA71036@raptor.research.att.com>
<<On Wed, 7 May 2003 21:18:08 -0400 (EDT), David Korn <yyy@xxxxxxxxxxxxxxxx> 
said:

> I notice that some systems do this

I would be shocked if not every system did this.

> and I came across it when trying to compile an application on a
> supposedly conformant system in which my application included a file
> in <...> of the same name that <stdio.h> had included in <...>.

This is indeed a concern, but I don't think that it has been
adequately addressed in a specification.  I recall having had to deal
with a bug in some program (I forget which one it was) which had a
similar issue.  I think it is generally an intractable problem, since
a future standard might well define a header using the name used in
some existing implementation of the same function, and there is no
mechanism to conditionalize the include path on the basis of the
current value of a set of feature-test macros.  Consider what would
happen if a program written to 1003.1-1990 had a local include file
called `mqueue.h'....

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.

-GAWollman

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