Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sdd.hp.com!spool.mu.edu!uunet!mcsun!hp4nl!charon!guido From: guido@cwi.nl (Guido van Rossum) Newsgroups: comp.std.c Subject: proper semi-portable use of signal()? Message-ID: <3223@charon.cwi.nl> Date: 26 Mar 91 13:15:24 GMT Article-I.D.: charon.3223 Sender: news@cwi.nl Lines: 27 I have some code that uses signal(). Nothing spectacular, e.g.: #include ... void (*sigsave)(); sigsave = signal(SIGINT, SIG_IGN); ... signal(SIGINT, sigsave); The compiler that comes closest to Standard C locally (gcc) warns about this code: sigsave = signal(SIGINT, SIG_IGN); warning: argument passing between incompatible pointer types signal(SIGINT, sigsave); warning: assignment between incompatible pointer types I don't see what's wrong. I noticed that the declaration for signal() in looks as follows: extern void (*signal(int, void (*) (int, ...)))(int, ...); Is the header wrong, is gcc overly worried, or is my code wrong? --Guido van Rossum, CWI, Amsterdam "What do you *mean* it's not in the computer!" -- Madonna