🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #2603

Re: proper semi-portable use of signal()?

#2603
From: Norman Diamond
Date: Wed, 27 Mar 1991 01:40
25 lines
1620 bytes
In article <3223@charon.cwi.nl> guido@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@cwi.nl>
>"What do you *mean* it's not in the computer!" -- Madonna
It's in the soft ware.
--
Norman Diamond       diamond@tkov50.enet.dec.com
If this were the company's opinion, I wouldn't be allowed to post it.
Technical Details
Message-ID: <1991Mar27.014048.18198@tkou02.enet.dec.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!elroy.jpl.nasa.gov!decwrl!pa.dec.com!shlump.nac.dec.com!tkou02.enet.dec.com!jit345!diamond
References: <3223@charon.cwi.nl>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!elroy.jpl.nasa.gov!decwrl!pa.dec.com!shlump.nac.dec.com!tkou02.enet.dec.com!jit345!diamond
From: diamond@jit345.swstokyo.dec.com (Norman Diamond)
Newsgroups: comp.std.c
Subject: Re: proper semi-portable use of signal()?
Message-ID: <1991Mar27.014048.18198@tkou02.enet.dec.com>
Date: 27 Mar 91 01:40:48 GMT
References: <3223@charon.cwi.nl>
Sender: news@tkou02.enet.dec.com (USENET News System)
Reply-To: diamond@jit345.enet@tkou02.enet.dec.com (Norman Diamond)
Organization: Digital Equipment Corporation Japan , Tokyo
Lines: 25