Article View: comp.lang.c++
Article #208Re: “The end of software secrecy is almost upon
From: Lawrence D’Oliveiro
Date: Fri, 23 Oct 2026 03:33
Date: Fri, 23 Oct 2026 03:33
33 lines
3145 bytes
3145 bytes
On Thu, 22 Oct 2026 11:18:03 -0400, James Kuyper wrote:
> On Thu, 22 Oct 2026 00:24:48 -0000 (UTC), Lawrence D’Oliveiro wrote:
>
>> The principle applies to Fortran as it does to any language where
>> you have to explicitly manage storage allocations.
>
> So, why can't you provide an example of storage allocation, where
> cleanup is relevant, so that using a GOTO would be problematic. That
> way we could have some idea what you're talking about.
The technique I use is based on a form of structured programming
called a “Nassi-Shneiderman diagram”. The overall structure looks like
... initialize object pointer to NULL ...
do /*once*/
{
... possible other stuff ...
... allocate object pointer ...
if (error occurred)
break;
... possible other stuff using object pointer ...
}
while (false);
... call free(3) (or equivalent) on object pointer ...
So you can see there is no way out of the inner block without passing
through the dispose call. Using gotos would contribute nothing except
make it harder to assure yourself of the simplicity of the control
flow.
Looks deceptively simple. But the same technique can scale up to quite
complex cases. Which we can get to, if you want.
Technical Details
Message-ID:
<11bekio$1eab6$4@dont-email.me>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mailReferences:
<11amvre$15far$1@dont-email.me> <11b5tdb$2cs5l$1@dont-email.me> <11b64cp$end$1@panix2.panix.com> <11b64hj$2faos$1@dont-email.me> <11b679m$6dl$1@panix2.panix.com> <11b6vc4$2npqv$1@dont-email.me> <11b87jg$37b7t$1@dont-email.me> <11b884b$p2o9$1@dont-email.me> <11b94he$3hdo3$2@dont-email.me> <11b9qd6$pq4i$1@dont-email.me> <11b9r5r$3nppf$1@dont-email.me> <11baekk$3v7n1$1@dont-email.me> <11bbl4f$du80$2@dont-email.me> <11bbo58$ek3q$1@dont-email.me> <11bbqns$fe31$1@dont-email.me> <11bbron$fmi2$1@dont-email.me> <11bc09b$gsv1$1@dont-email.me> <11bc3m0$hnan$1@dont-email.me> <11bc4m2$i1rd$1@dont-email.me> <11bd9fd$v6su$1@dont-email.me>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: Lawrence D’Oliveiro <ldo@nz.invalid> Newsgroups: comp.lang.fortran,comp.lang.c++,alt.comp.lang.rust,alt.folklore.computers Subject: Re: “The end of software secrecy is almost upon Date: Fri, 23 Oct 2026 03:33:44 -0000 (UTC) Organization: A noiseless patient Spider Lines: 33 Message-ID: <11bekio$1eab6$4@dont-email.me> References: <11amvre$15far$1@dont-email.me> <11b5tdb$2cs5l$1@dont-email.me> <11b64cp$end$1@panix2.panix.com> <11b64hj$2faos$1@dont-email.me> <11b679m$6dl$1@panix2.panix.com> <11b6vc4$2npqv$1@dont-email.me> <11b87jg$37b7t$1@dont-email.me> <11b884b$p2o9$1@dont-email.me> <11b94he$3hdo3$2@dont-email.me> <11b9qd6$pq4i$1@dont-email.me> <11b9r5r$3nppf$1@dont-email.me> <11baekk$3v7n1$1@dont-email.me> <11bbl4f$du80$2@dont-email.me> <11bbo58$ek3q$1@dont-email.me> <11bbqns$fe31$1@dont-email.me> <11bbron$fmi2$1@dont-email.me> <11bc09b$gsv1$1@dont-email.me> <11bc3m0$hnan$1@dont-email.me> <11bc4m2$i1rd$1@dont-email.me> <11bd9fd$v6su$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Fri, 23 Oct 2026 03:33:45 +0000 (UTC) Injection-Info: dont-email.me; logging-data="1517926"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18QzY4yJFCQ+JnxXi7Npl9T"; posting-host="cd3e8028f1d3649c19eedc89390593ce" User-Agent: Pan/0.165 (Kostiantynivka) Cancel-Lock: sha1:Wt8NKTyCoufekP8O+AyjfNhsoJY= sha256:3XXbFEp+VoafY0wyeoTTIb9iT2h4VMNu/mZCf1svzaE= sha1:Kb555NpHG/jdcLfu7nU6mY5FQAk= sha256:Bx8Qk0rQsMIzZ0RUCCnGiD6i6SE6ymjrW8I1sD2hvL4=