From owner-freebsd-questions Fri Jan 24 9:40:37 2003 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 598F037B401 for ; Fri, 24 Jan 2003 09:40:35 -0800 (PST) Received: from falcon.midgard.homeip.net (h76n3fls20o913.telia.com [213.67.148.76]) by mx1.FreeBSD.org (Postfix) with SMTP id 88A3E43EB2 for ; Fri, 24 Jan 2003 09:40:33 -0800 (PST) (envelope-from erikt@falcon.midgard.homeip.net) Received: (qmail 25101 invoked by uid 1001); 24 Jan 2003 17:40:32 -0000 Date: Fri, 24 Jan 2003 18:40:32 +0100 From: Erik Trulsson To: slavomir katuscak Cc: freebsd-questions@freebsd.org Subject: Re: problem with sys/select.h and sys/types.h Message-ID: <20030124174031.GA24988@falcon.midgard.homeip.net> Mail-Followup-To: slavomir katuscak , freebsd-questions@freebsd.org References: <200301241824.36843.katus0bm@artax.karlin.mff.cuni.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200301241824.36843.katus0bm@artax.karlin.mff.cuni.cz> User-Agent: Mutt/1.5.3i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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 > #include > > int main(void) { > } > > example 2: > #include > #include > > 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. -- Erik Trulsson ertr1013@student.uu.se To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message