volatile (Really BSD signal handler)
Eddie Wyatt
edw at IUS1.CS.CMU.EDU
Fri Apr 1 07:51:50 AEST 1988
>>> static void catch(int signo) { gotcha = 1; }
>>PLEASE, declare the signal handler correctly Mr. Lint :-).
>
>I did. Note that I was writing a "strictly conforming program".
>
>>static void catch(int signo, code; struct sigcontext *scp) { gotcha = 1; }
>>
>>In the pass I've had my signal handle return to random pieces of
>>code by not having the correct definition.
>
>Yeah, I've also been bitten occasionally by bugs in Berzerkeley code.
It's questionable whether its a bug or not. The Sun man page reads:
The handler routine can be declared:
handler(sig, code, scp)
int sig, code;
struct sigcontext *scp;
What bothers me about this entry is it doesn't say you have to
declare the function that way. There's no entry in the BUGS
section eluding to what happen if you don't conform either.
--
Eddie Wyatt e-mail: edw at ius1.cs.cmu.edu
More information about the Comp.lang.c
mailing list