Hello,

From: Edwin Eyan Moragas <e...@yndy.org>
Subject: clobbered by `longjmp' warning
Date: Tue, 10 Aug 2010 08:20:49 +0800
> i have this warning when i compile picolisp in obsd 4.7:
> 
> flow.c: In function `doCatch':
> flow.c:1351: warning: argument `x' might be clobbered by `longjmp' or `vfork'

The patch

- any doCatch(any x) {
+ any doCatch(volatile any x) {
    any y;
    catchFrame f;
 

may works.

setjmp() saves some of the registers which longjmp() will recover.  If
some variable assigned to a register changes its value after a call of
setjump(), its value may be recovered by a call of longjmp().  To
prevent such an unexpected recovery, you should tell the compiler that
the value of the variable may be modified between the call of
setjump() and the call of the jongjmp() by using the keyword
`volatile'.

Kamo Hiroyasu [Kamo is the family name and Hiroyasu the given name.]

Reply via email to