Date: Fri, 24 Jan 2003 18:40:32 +0100 From: Erik Trulsson <ertr1013@student.uu.se> To: slavomir katuscak <katus0bm@artax.karlin.mff.cuni.cz> Cc: freebsd-questions@freebsd.org Subject: Re: problem with sys/select.h and sys/types.h Message-ID: <20030124174031.GA24988@falcon.midgard.homeip.net> In-Reply-To: <200301241824.36843.katus0bm@artax.karlin.mff.cuni.cz> References: <200301241824.36843.katus0bm@artax.karlin.mff.cuni.cz>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Jan 24, 2003 at 06:24:36PM +0100, slavomir katuscak wrote:
> i found this problem (maybe bug) in freebsd 4.7 stable
> i have two programs uses sys/select.h and sys/types.h:
>
> example 1:
> #include <sys/select.h>
> #include <sys/types.h>
>
> int main(void) {
> }
>
> example 2:
> #include <sys/types.h>
> #include <sys/select.h>
>
> int main(void) {
> }
>
> first example returns this error messages:
>
> In file included from /usr/include/sys/select.h:40,
> from test.c:1:
> /usr/include/sys/event.h:52: syntax error before `uintptr_t'
> /usr/include/sys/event.h:54: syntax error before `u_short'
> In file included from pokus.c:1:
> /usr/include/sys/select.h:47: syntax error before `pid_t'
>
> but second is ok.
>
> i don't have tested this in 5.0 release yet.
I don't think that is a bug. I believe it is working as intended.
Many header files require other header files to be included first.
One common case is that sys/types.h need to be included before some
other header file is included. sys/select.h apparently needs this.
One might argue that each header file should include all other files it
needs, but that is a policy question and the current policy is to not
do it that way.
--
<Insert your favourite quote here.>
Erik Trulsson
ertr1013@student.uu.se
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030124174031.GA24988>
