Mail Archives: djgpp/1998/03/16/20:15:22
On Fri, 13 Mar 1998, Anthony.Appleyard wrote:
> What the rules for deciding whether longjmp may `clobber' a particular local
> variable or a `*this'? (I never use vfork().)
Eli Zaretski replied:-
> * A nonvolatile automatic variable might be changed by a call to `longjmp'.
> These warnings as well are possible only in optimizing compilation. ... The
> easiest solution is to declare the variable `volatile' (and have some
> sub-optimal optimization). ...
In the affected program, one of the many `clobbered' complaints comes from
main():-
main(int nargs,char**Arg){Subr*S; char*s,*t,*U,**arg; jmp_buf emacserror;
int i,j,k,m,n,w,F; int ctrlc_old=__djgpp_set_ctrl_c(0); ...
main.cc:49: warning: variable `volatile char * T' might be clobbered by
`longjmp' or `vfork'
so I changed these two lines to this:-
main(int nargs,char**Arg){Subr*S; char*s,*U,**arg; jmp_buf emacserror;
int i,j,k,m,n,w,F; int ctrlc_old=__djgpp_set_ctrl_c(0); volatile char*T;
but this did not get rid of the warning but merely created two more warnings:-
main.cc: In function `int main(int, char **)':
main.cc:268: warning: passing `volatile char *' as argument 1 of
`strlen(const char *)' discards volatile
main.cc:273: warning: passing `volatile char *' as argument 2 of
`strcpy(char *, const char *)' discards volatile
main.cc:49: warning: variable `volatile char * T' might be clobbered by
`longjmp' or `vfork'
- Raw text -