🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: does an expression in a logical statement need parenthesis for proper evaluation?

#791
From: Lynn McGuire
Date: Sat, 07 Nov 2026 20:39
42 lines
3559 bytes
On 11/7/2026 1:39 PM, Janis Papanagnou wrote:
> On 2026-11-07 12:48, David Brown wrote:
>> [...]
>>
>> My impression is that he is still fiddling with his fork of f2c with 
>> an aim to getting as much automation as he can to minimise the manual 
>> cleanup, but I could easily be wrong here.  I have no idea if it is 
>> possible to automate something to help with such gotos.
> 
> It might suffice for such an automation tasks to just mirror such
> 'goto' structures (unless you intend to create better structured
> code through code transformations). - Not long ago I refactored a
> legacy program to obtain an equivalent implementation in another
> language and the de-spaghettifying turned out to have been really
> nasty. (The code had severely convoluted 'goto's and not a single
> structured element.) - In principal it's possible to de-'goto' any
> source code to obtain structured code. Since I've no experience
> with such tools I'm curious what experiences exists in that respect,
> especially for trans-language transformations (from a heavily 'goto'
> biased language (BASIC, FORTRAN?) to some structured language). -
> While looking into the Net and concerning this thread I stumbled
> across this reply, though:
>    "f2c or pet (for Fortran/C): Older research tools designed
>     to parse flat code graphs and reconstruct clean, structured
>     if/else and loop components."
> which gave the impression that 'f2c' would be able to remove those
> 'goto's and so I'm wondering why there's (still) 'goto's in the
> OP's sample code.
> 
> Janis

F2C is automagically restructuring my code to the first level.  Maybe 
the second level sometimes.  The number of gotos is reduced by 80 or 
90%.  Way past the point that I don't care.  If a goto is jumping 
halfway down a method then replacing it with a monster if then is just 
crazy so F2C skips that case.  I am not modifying F2C anymore.

If wanted, I can post comparisons of a couple of my subroutines and the 
resulting methods.

Lynn
Technical Details
Message-ID: <11co2au$3pku5$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: <11cj4a0$23796$1@dont-email.me> <11cj994$24m06$1@dont-email.me> <11ck0pr$2amtc$1@dont-email.me> <11cl7i3$2pbh3$1@kst.eternal-september.org> <11cn35u$3cl3b$2@dont-email.me> <11cnuq2$23539$12@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: Lynn McGuire <lynnmcguire5@gmail.com>
Newsgroups: comp.lang.c++,comp.lang.c
Subject: Re: does an expression in a logical statement need parenthesis for
 proper evaluation?
Date: Sat, 7 Nov 2026 14:39:55 -0600
Organization: A noiseless patient Spider
Lines: 42
Message-ID: <11co2au$3pku5$1@dont-email.me>
References: <11cj4a0$23796$1@dont-email.me> <11cj994$24m06$1@dont-email.me>
 <11ck0pr$2amtc$1@dont-email.me> <11cl7i3$2pbh3$1@kst.eternal-september.org>
 <11cn35u$3cl3b$2@dont-email.me> <11cnuq2$23539$12@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 07 Nov 2026 20:39:58 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="3986373"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX18RYozFlHJu325AruaJrjTBFZKPRpDW0gw="; posting-host="8a062a357b2fdc9e5303d80b13005484"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:33T9IRTY9CguaHTetgcSXk5MA90= sha256:2sN/sdozQAqoITH0/GURsz0vP5f1QziAebLd0UQt2GE=
	sha1:42aPq6ognNHU4W6JDuxV5DBsxc8= sha256:2Hs8qDOzPdjeCxWq3pz4DnZ1P3nWMUcqN26HXN7D4RQ=
In-Reply-To: <11cnuq2$23539$12@dont-email.me>
Content-Language: en-US