[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=whvSAi1+fr=YSXU=Ax204V1TP-1c_3Y3p2TjznxSo=_3Q@mail.gmail.com>
Date: Mon, 18 Aug 2025 16:00:44 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Al Viro <viro@...iv.linux.org.uk>
Cc: David Laight <david.laight.linux@...il.com>, Thomas Gleixner <tglx@...utronix.de>,
LKML <linux-kernel@...r.kernel.org>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>, Peter Zijlstra <peterz@...radead.org>,
Darren Hart <dvhart@...radead.org>, Davidlohr Bueso <dave@...olabs.net>,
André Almeida <andrealmeid@...lia.com>, x86@...nel.org,
Christian Brauner <brauner@...nel.org>, Jan Kara <jack@...e.cz>, linux-fsdevel@...r.kernel.org
Subject: Re: [patch 0/4] uaccess: Provide and use helpers for user masked access
On Mon, 18 Aug 2025 at 15:21, Al Viro <viro@...iv.linux.org.uk> wrote:
>
> I suspect that folks with "goto is a Bad Word(tm)" hardon had been told
> that goto was always avoidable, but had never bothered to read the proof...
I think it's just a combination of compiler people historically
finding purely structured loops easier to analyze (back before modern
things like SSA).
Together with language people who wanted to point out that "modern"
languages had structures loop constructs.
Both issues go back to the 1960s, and both are entirely irrelevant
today - and have been for decades. It's not like you need to actively
teach people to use for-loops instead of 'goto' these days.
Now, I don't advocate 'goto' as a general programming model, but for
exception handling it's superior to any alternative I know of.
Exceptions simply DO NOT NEST, and 'try-catch-finally' is an insane
model for exceptions that has only made things worse both for
compilers and for programmers.
So I do think using labels (without any crazy attempt nesting syntax)
is objectively the superior model.
And the 'finally' mess is much better handled by compilers dealing
with cleanup - again without any pointless artificial nesting
structures. I think most of our <linux/cleanup.h> models have been
quite successful.
Linus
Powered by blists - more mailing lists