🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

exceptions, unexpected() and muddle_on()

#1231
From: David Spuler
Date: Mon, 14 Dec 1992 20:06
23 lines
1152 bytes
On page 320, Stroustrup, 2nd edition, declares the function

void muddle_on() { cerr << "muddling on\n";  }

and installs it so as to be called by unexpected().

My question is: what happens if a function installed by set_unexpected returns?
Stroustrup says

"This will cause a normal return from a function detecting an unexpected
exception. .... "

I don't see how this can happen. 
Does the throw expression return and execution continue from there??
(Seems not since this could be way down deep in the stack.)
Or does the function which raised the unexpected exception just return with a
garbage return value?

The ARM seems to have nothing to say about set_unexpected functions returning.

Any insight appreciated,
David Spuler
Technical Details
Message-ID: <spuler.724363604@coral>
Path: arc1-ca.pugleaf.net!sparky!uunet!munnari.oz.au!bunyip.cc.uq.oz.au!marlin.jcu.edu.au!coral.cs.jcu.edu.au!spuler

Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c++
Path: arc1-ca.pugleaf.net!sparky!uunet!munnari.oz.au!bunyip.cc.uq.oz.au!marlin.jcu.edu.au!coral.cs.jcu.edu.au!spuler
From: spuler@coral.cs.jcu.edu.au (David Spuler)
Subject: exceptions, unexpected() and muddle_on()
Message-ID: <spuler.724363604@coral>
Sender: news@marlin.jcu.edu.au (USENET News System)
Organization: James Cook University
Date: 14 Dec 92 20:06:44 GMT
Lines: 23