proper semi-portable use of signal()?

Norman Diamond diamond at jit345.swstokyo.dec.com
Wed Mar 27 11:40:48 AEST 1991


In article <3223 at charon.cwi.nl> guido at cwi.nl (Guido van Rossum) writes:

>... the declaration for signal() in <signal.h> looks as follows:
>	extern void	(*signal(int, void (*) (int, ...)))(int, ...);

>[gcc complains about:]
>	#include <signal.h>
>	void (*sigsave)();
You did not declare void (*sigsave)(int, ...);
>	sigsave = signal(SIGINT, SIG_IGN);
>	warning: argument passing between incompatible pointer types
What is the definition of SIG_IGN in your machine's <signal.h> ?
>	signal(SIGINT, sigsave);
>	warning: assignment between incompatible pointer types
Because your sigsave must point to a non-varargs function.

>Is the header wrong, is gcc overly worried, or is my code wrong?
 Maybe (SIG_IGN?)   , Maybe / Maybe not    , AND yes

>--Guido van Rossum, CWI, Amsterdam <guido at cwi.nl>
>"What do you *mean* it's not in the computer!" -- Madonna
It's in the soft ware.
--
Norman Diamond       diamond at tkov50.enet.dec.com
If this were the company's opinion, I wouldn't be allowed to post it.



More information about the Comp.std.c mailing list