Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!uunet!mcsun!hp4nl!charon!guido From: guido@cwi.nl (Guido van Rossum) Newsgroups: comp.std.c Subject: Re: proper semi-portable use of signal()? Message-ID: <3228@charon.cwi.nl> Date: 27 Mar 91 09:18:23 GMT References: <3223@charon.cwi.nl> <1991Mar27.014048.18198@tkou02.enet.dec.com> Sender: news@cwi.nl Lines: 27 In article <3223@charon.cwi.nl> I asked: >>... the declaration for signal() in looks as follows: >> extern void (*signal(int, void (*) (int, ...)))(int, ...); >> >>[gcc complains about:] >> #include >> void (*sigsave)(); >> ... >> signal(SIGINT, sigsave); Norman Diamond replies: >You did not declare void (*sigsave)(int, ...); Indeed, but I believe my code conforms to the Standard: 4.7.1.1 lists the second argument of signal() as void (*func)(int), not as void (*func)(int, ...). I thought varargs (sorry, stdarg) functions *had* to be declared with prototypes, while for functions with fixed argument lists, old style declarations were also acceptable. Therefore I believe my declaration is compatible with the standard, while the in question (provided by SGI) is not. Any other opinions? --Guido van Rossum, CWI, Amsterdam "The life of a Repo Man is always intense"