From owner-freebsd-hackers Tue Apr 20 12: 9: 8 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from uni4nn.gn.iaf.nl (osmium.gn.iaf.nl [193.67.144.12]) by hub.freebsd.org (Postfix) with ESMTP id 19AD6157FE for ; Tue, 20 Apr 1999 12:08:59 -0700 (PDT) (envelope-from wilko@yedi.iaf.nl) Received: (from uucp@localhost) by uni4nn.gn.iaf.nl (8.9.2/8.9.2) with UUCP id UAA30976; Tue, 20 Apr 1999 20:38:05 +0200 (MET DST) Received: (from wilko@localhost) by yedi.iaf.nl (8.9.3/8.6.12) id UAA01002; Tue, 20 Apr 1999 20:33:56 +0200 (CEST) From: Wilko Bulte Message-Id: <199904201833.UAA01002@yedi.iaf.nl> Subject: Re: Is it ok to include sys/signal.h directly? In-Reply-To: from John Baldwin at "Apr 19, 1999 11:42:19 pm" To: jobaldwi@vt.edu (John Baldwin) Date: Tue, 20 Apr 1999 20:33:56 +0200 (CEST) Cc: freebsd-hackers@FreeBSD.ORG X-Organisation: Private FreeBSD site - Arnhem, The Netherlands X-pgp-info: PGP public key at 'finger wilko@freefall.freebsd.org' X-Mailer: ELM [version 2.4ME+ PL43 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG As John Baldwin wrote ... > Well, no response on -questions, so I figured I'd try -hackers. :) Well, in case it is any consolation compiling netatalk (netatalk-1.4b2 to be exact) fails exactly in the same fashion: gcc -p -DBSD4_4 -O2 -I../../include -c asp_getsess.c In file included from asp_getsess.c:7: /usr/include/sys/signal.h:163: parse error before `size_t' /usr/include/sys/signal.h:163: warning: no semicolon at end of struct or union /usr/include/sys/signal.h:165: parse error before `}' Tried this yesterday evening and have not tried to find out why. On 2.2.8-stable this worked like a charm, on 3.1-stable it does not Wilko > > -----FW: Is it ok to include sys/signal.h directly?----- > > I've a question, should programs always include /usr/include/signal.h or is it > ok for them to include /usr/include/sys/signal.h directly? Currently on 3.0+ > programs that include sys/signal.h fail to compile. I.e.: > > > cat temp.c > #include > #include > > void main() > { > printf("foobar\n"); > } > > make temp.o > cc -O -pipe -c temp.c > In file included from temp.c:1: > /usr/include/sys/signal.h:163: parse error before `size_t' > /usr/include/sys/signal.h:163: warning: no semicolon at end of struct or union > /usr/include/sys/signal.h:165: parse error before `}' > *** Error code 1 > > Stop. > > They die because size_t is not defined when the sigaltstack struct is defined. > In /usr/include/signal.h, machine/ansi.h is #include'd before sys/signal.h so > that this problem is avoided. If it is desirable for programs to include just > sys/signal.h by itself, then this patch would fix the problem: > > --- signal.h.orig Sat Apr 17 15:33:02 1999 > +++ signal.h Sat Apr 17 15:33:37 1999 > @@ -45,6 +45,7 @@ > #include > #include > #include /* sig_atomic_t; trap codes; sigcontext */ > +#include > > #if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE) > #define NSIG 32 /* counting 0; could be 33 (mask is 1-32) */ > > Note that these programs worked fine on 2.2.x, AFAIK. At least, one of the > ports (devel/cccc) #include'd sys/signal.h, and it was broken in 3.0 but worked > in 2.2. Groeten / Cheers, Wilko _ ______________________________________________________________________ | / o / / _ Arnhem, The Netherlands |/|/ / / /( (_) Bulte WWW : http://www.tcja.nl _______________________ Powered by FreeBSD ___ http://www.freebsd.org _____ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message