volatile

Eddie Wyatt edw at IUS1.CS.CMU.EDU
Thu Mar 31 08:19:01 AEST 1988


An aside:

> #include <signal.h>
> 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 at ius1.cs.cmu.edu



More information about the Comp.lang.c mailing list