Shouldn't this work?

gwyn at BRL-VLD.ARPA gwyn at BRL-VLD.ARPA
Fri Aug 24 09:14:59 AEST 1984


From:      Doug Gwyn (VLD/VMB) <gwyn at BRL-VLD.ARPA>

There is nothing wrong with your example.  I suspect you are using
an old (pre-UNIX System V) portable C compiler (e.g. UNIX System III
or 4.[12]BSD); these do not correctly handle pointers to void-
valued functions.  Lint is built from PCC sources and has the same
problem.  Starting with Release 1.0 of UNIX System V, the portable
C compiler and lint handled this correctly.  I tried the Gould UTX
C compiler on this very thing and it is better than usual, but not
yet perfect.

I believe that the reason that the signal() function has been
misdefined for so long is that the compilers could not handle
the correct type declaration.  I urge the UNIX developers to FIX
THIS now that their compilers are working:

extern void	(*signal())();
#define	SIG_DFL	(void (*)())0
#define	SIG_IGN	(void (*)())1



More information about the Comp.lang.c mailing list