🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.help
Article #861

Re: setjmp/longjmp in C++

#861
From: 7114075
Date: Mon, 18 Dec 1995 18:04
17 lines
1068 bytes
In <9512171357.AA03464@msil.sps.mot.com>, alexr@msil.sps.mot.COM (Alex Rezinsky) writes:
>
>        Hi all,
>
>Can I use setjmp/longjmp routines in C++ environment (g++ compiler)?
>Do they save/restore C++ environment correctly?
>Does longjmp call default destructors?
>
>Thanks,
>Alex

Alex;
	Yes, you can use setjmp/longjmp. No, you shouldn't. They do not
call destructors, and in fact, unless used very carefully, are almost
guaranteed to mess up memory. Exception handling will address these
problems, but I don't know of any compilers currently implementing
exception handling according to the standard.
Technical Details
Message-ID: <4b4aeo$p0l@dub-news-svc-2.compuserve.com>
Path: arc1-ca.pugleaf.net!news.compuserve.com!newsmaster
References: <9512171357.AA03464@msil.sps.mot.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!news.compuserve.com!newsmaster
From: 71140,75@compuserve.com
Newsgroups: gnu.g++.help,comp.lang.c++
Subject: Re: setjmp/longjmp in C++
Date: 18 Dec 1995 18:04:08 GMT
Organization: CompuServe Incorporated
Message-ID: <4b4aeo$p0l@dub-news-svc-2.compuserve.com>
References: <9512171357.AA03464@msil.sps.mot.com>
Reply-To: 71140,75@compuserve.com
NNTP-Posting-Host: ad27-155.compuserve.com
X-Newsreader: IBM NewsReader/2 v1.09