Date: Tue, 20 Apr 1999 20:33:56 +0200 (CEST) From: Wilko Bulte <wilko@yedi.iaf.nl> To: jobaldwi@vt.edu (John Baldwin) Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: Is it ok to include sys/signal.h directly? Message-ID: <199904201833.UAA01002@yedi.iaf.nl> In-Reply-To: <XFMail.990419234219.jobaldwi@vt.edu> from John Baldwin at "Apr 19, 1999 11:42:19 pm"
next in thread | previous in thread | raw e-mail | index | archive | help
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 <sys/signal.h> > #include <stdio.h> > > 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 <sys/cdefs.h> > #include <sys/_posix.h> > #include <machine/signal.h> /* sig_atomic_t; trap codes; sigcontext */ > +#include <machine/ansi.h> > > #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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199904201833.UAA01002>