proper semi-portable use of signal()?

Doug Gwyn gwyn at smoke.brl.mil
Thu Mar 28 08:04:42 AEST 1991


In article <3223 at charon.cwi.nl> guido at cwi.nl (Guido van Rossum) writes:
>I don't see what's wrong.  I noticed that the declaration for signal()
>in <signal.h> looks as follows:
>	extern void	(*signal(int, void (*) (int, ...)))(int, ...);

The header is wrong (i.e. not part of a conforming implementation).
The signal handler function does NOT have a variable argument list,
but always receives precisely one argument of type int.  The ,... is
a bogus attempt to accommodate 4.2BSD-style signal handers.  If some
recent modification has been made to POSIX.1 that requires this, it
is WRONG and in general incompatible with the C standard.  (This issue
was carefully discussed at both X3J11 and P1003 levels before the
original standards were adopted.)



More information about the Comp.std.c mailing list