🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c++
Article #759

Re: The end of software secrecy is almost upon

#759
From: boltar
Date: Fri, 06 Nov 2026 16:38
36 lines
3021 bytes
On Fri, 06 Nov 2026 12:43:08 +0100
Rosario19 <Ros@invalid.invalid> gabbled:
>On Tue, 20 Oct 2026 23:18:44 GMT, Charlie Gibbs wrote:
>>On 2026-10-20, Lawrence D’Oliveiro <ldo@nz.invalid> wrote:
>>
>>> On Tue, 20 Oct 2026 19:04:55 GMT, Charlie Gibbs wrote:
>>>
>>>> The undisciplined use of GOTOs is bad, agreed.
>>>
>>> Is there such a thing as a *disciplined* use of gotos?
>>
>>Yes, especially in COBOL or assembly language.  For instance,
>>a GOTO to the end of a function ensures any of its cleanup code
>>gets executed, and fulfils a goal of structured proramming:
>>each function has one exit point.
>>
>>> I find the C code I write tends to do a lot of dynamic resource
>>> allocations. These can sometimes fail with errors. So error recovery
>>> will invariably involve cleaning up those parts of the allocations
>>> which already succeeded. 
>
>> Gotos are no good for this; you need to exit
>>> levels of structure nesting one by one, disposing of allocations as
>>> you go.
>
>If in the start of the function all pointer are NULL, and in the end
>of the function there are all the free() 
>I not have find all your problems with possibly multiple goto that
>point to the end of the function

This is also a reason the only-one-exit-point nonsense mentioned above is a
Very Bad Idea unless its a simple function because you may have to do a load
of checks that wouldn't be required if the flow of control left at an earlier
point. Also with too much block nesting it becomes unreadable even in the best 
IDEs.
Technical Details
Message-ID: <11ckvq4$1k59e$1@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-mail
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> <11b6u68$2neta$1@dont-email.me> <11b6v90$2nine$3@dont-email.me> <11b87t8$379mv$1@dont-email.me> <11b8b2k$p44i$1@dont-email.me> <rXOBS.7015$5Iy.3911@fx04.iad> <11b8h83$3b48o$1@dont-email.me> <oFSBS.93666$Q3f.6740@fx05.iad> <kterellanc36d5bku3tov78jmflfnboa42@4ax.com>

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: boltar@caprica.universe
Newsgroups: comp.lang.c++
Subject: Re: The end of software secrecy is almost upon
Date: Fri, 6 Nov 2026 16:38:28 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 36
Message-ID: <11ckvq4$1k59e$1@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> <11b6u68$2neta$1@dont-email.me> <11b6v90$2nine$3@dont-email.me> <11b87t8$379mv$1@dont-email.me> <11b8b2k$p44i$1@dont-email.me> <rXOBS.7015$5Iy.3911@fx04.iad> <11b8h83$3b48o$1@dont-email.me> <oFSBS.93666$Q3f.6740@fx05.iad> <kterellanc36d5bku3tov78jmflfnboa42@4ax.com>
Content-Type: text/plain; charset=utf-8
Injection-Date: Fri, 06 Nov 2026 16:38:29 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="1709358"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX19XCZ2mjBpXFZlQ56beluvW"; posting-host="1a490c947cddfc455ec8d5bc2270be77"
Cancel-Lock: sha1:QYSC9n+hO0Eiu4km78XWJ3RwyIw= sha256:7WLoj+xiOVd8grF0cVROKIyQea8WpkYlLM8NrhXCjNU=
	sha1:MaRHAaKJg8x3xM2W14GAILVazYo= sha256:162IDSZjgK56NqIryQJIlIzkw7UpMGaSr1z2IimcAwU=