Path: utzoo!mnetor!uunet!husc6!bbn!rochester!PT.CS.CMU.EDU!IUS1.CS.CMU.EDU!edw From: edw@IUS1.CS.CMU.EDU (Eddie Wyatt) Newsgroups: comp.lang.c Subject: Re: volatile Message-ID: <1264@PT.CS.CMU.EDU> Date: 30 Mar 88 22:19:01 GMT References: <12578@brl-adm.ARPA> <1988Mar25.172355.348@utzoo.uucp> <3237@haddock.ISC.COM> Sender: netnews@PT.CS.CMU.EDU Organization: Carnegie-Mellon University, CS/RI Lines: 28 Summary: signal handler An aside: > #include > static sig_atomic_t volatile gotcha; > static void catch(int signo) { gotcha = 1; } > int main(void) { > (void)signal(SIGINT, catch); > gotcha = 0; > do; while (!gotcha); > return (0); > } PLEASE, declare the signal handler correctly Mr. Lint :-). 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. I attributed the problem of local's of the signal handle being over layed onto the stack context pointer. The problem was fixed by using the suggested defination for the signal handle which seems to confirm the suspicion. -- Eddie Wyatt e-mail: edw@ius1.cs.cmu.edu