Sujet : Re: encapsulating directory operations
De : Bonita.Montero (at) *nospam* gmail.com (Bonita Montero)
Groupes : comp.lang.cDate : 08. Jun 2025, 16:18:03
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <10249is$3tavs$4@raubtier-asyl.eternal-september.org>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
User-Agent : Mozilla Thunderbird
Am 08.06.2025 um 17:08 schrieb
Muttley@DastardlyHQ.org:
Its no different to C++ exceptions except obviously no destructors
are called so there's no chance to do a tidy up at each stack level.
It's much more complicated than exceptions because the functions where
the error raises and where the error is "caught" need shared global
variables. C++ doesn't need that, just throw and catch and everything
is glued to the runtime.
And the problem with your solution is: All functions between the setjmp-
and the longjmp-calls don't have any cleanup, i.e. they don't handle
back their opened resources to the runtime or the kernel. With RAII in
combination with exceptions that's for free.
Do you really think setjmp() / longjmp() is a competitive solution ?
You're naive.