🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #1522

Re: Uncaught exceptions

#1522
From: Etay Bogner
Date: Tue, 01 Aug 1995 07:02
46 lines
2770 bytes
> someone wrote :
> > > I cannot see any logical argument why one of
> > >       a) unwinding the whole stack or
> > >       b) just terminating without unwinding it
> > > should be prefered by this principle.

>Unless the draft standard specifies that a call to
>"terminate" may ONLY be used for debugging purposes, it is
>both legal and likely for it to do something else, such as
>printing a message before exiting.

>Unless the standard is worded in such a way as to disallow
>the function passed to "set_terminate" below, I believe I
>have here an example of a program that could be used to
>detect such a difference in implementation.  Hence, one
>choice or another code be enforced (I have encoded my
>preferences into this test program's choice of PASS and
>FAIL).

I really can't see what's the connection between your message and example to the issue here.
The original question ( I believe ) was why it is un-specified in the standard whether the stack 
is unwind when terminate is called.

I gave a simple answer to this Q.
You can write whatever terminate/unexpected function you like. It really doesn't answer the Q.

It's a simple fact that if the standard commitee enforced "a", some people wouldn't be happy since 
they couldn't debug their programs as they used to.

>I believe I have here an example of a program that could be used to
>detect such a difference in implementation

The sample code you wrote just indicate ( detect ) whether or not the detructors are called, which 
is NOT that useful ...

This Q should be addressed by compiler vendors, when supplying a compiler + debugger. The commitee 
gave them the right to choose, just for implmenting a debugger.

And all this doesn't say that terminate "may ONLY be used for debugging purposes". A programmer 
can choose to exit that way from his program, if he likes that.

-- Etay Bogner,
-- ebogner@ird.scitex.com ( OLD ),
-- Etay_Bogner@mail.stil.scitex.com,
-- Scitex Corp.
-- Israel.
Technical Details
Message-ID: <3vkjiq$ocn@lyman.pppl.gov>
Path: arc1-ca.pugleaf.net!nntpserver.pppl.gov!usenet
References: <smeyersDBLDnH.1z7@netcom.com> <3u0o82$gg4@wcap.centerline.com> <3u7e1h$s5@engnews2.Eng.Sun.COM> <3ua4bq$im4@wcap.centerline.com> <3v2vj6$kha@metro.ucc.su.OZ.AU> <3vb50v$rk5@wcap.centerline.com> <3vdt05$inn@lyman.pppl.gov> <3virb9$89p@wcap.centerline.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!nntpserver.pppl.gov!usenet
From: Etay Bogner <ebogner@ird.scitex.com>
Newsgroups: comp.std.c++
Subject: Re: Uncaught exceptions
Date: 1 Aug 1995 07:02:50 GMT
Organization: Scitex Corp.
Message-ID: <3vkjiq$ocn@lyman.pppl.gov>
References: <smeyersDBLDnH.1z7@netcom.com> <3u0o82$gg4@wcap.centerline.com> <3u7e1h$s5@engnews2.Eng.Sun.COM> <3ua4bq$im4@wcap.centerline.com> <3v2vj6$kha@metro.ucc.su.OZ.AU> <3vb50v$rk5@wcap.centerline.com> <3vdt05$inn@lyman.pppl.gov> <3virb9$89p@wcap.centerline.com>
NNTP-Posting-Host: metay_pc.scitex.com
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 1.1N (Macintosh; I; PPC)
To: chase@centerline.com
X-URL: news:3virb9$89p@wcap.centerline.com