Mail Archives: djgpp/1996/03/24/07:34:52
In article <Pine DOT SUN DOT 3 DOT 91 DOT 960321172112 DOT 25106R-100000 AT is>, eliz AT is DOT elta DOT co DOT il
says...
>
>
>On Thu, 21 Mar 1996, A.Appleyard wrote:
>> main.cc: In function `int main(int, char **)':
>> main.cc:33: warning: variable `class buffer * C' might be clobbered by
>> `longjmp' or `vfork'
>
>I'd imagine that if you use longjmp in certain circumstances, some of the
>destructors for variables that are on the parts of the stack which longjmp
>unwinds aren't called. That's why the exceptions were introduced into
>C++, right?
No! The problem is that local variables that are put in machine registers by
gcc, for example when it's optimizing the code, are not restored properly
after a longjmp. There is a good reason for this, but at the moment I donät
seem to remember it. Sorry.
- Jonas Öster
- Raw text -