www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/03/24/07:34:52

Xref: news2.mv.net comp.os.msdos.djgpp:2098
From: ake DOT oster AT mailbox DOT swipnet DOT se (Åke Öster)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: When and how does longjmp() `clobber' variables?
Date: 23 Mar 1996 08:48:05 GMT
Organization: -
Lines: 21
Message-ID: <4j0ds5$rjq@mn5.swip.net>
References: <Pine DOT SUN DOT 3 DOT 91 DOT 960321172112 DOT 25106R-100000 AT is>
NNTP-Posting-Host: dialup100-6-4.swipnet.se
Mime-Version: 1.0
NNTP-Posting-User: 57af7496bcb38a902b86939c9f6ffdbe
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019