[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250209190211.5a11d6d6@pumpkin>
Date: Sun, 9 Feb 2025 19:02:11 +0000
From: David Laight <david.laight.linux@...il.com>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org, Alexander
Viro <viro@...iv.linux.org.uk>, Christian Brauner <brauner@...nel.org>, Jan
Kara <jack@...e.cz>, Arnd Bergmann <arnd@...db.de>, Kees Cook
<kees@...nel.org>
Subject: Re: [PATCH 1/2] uaccess: Simplify code pattern for masked user
copies
On Sun, 9 Feb 2025 10:46:03 -0800
Linus Torvalds <torvalds@...ux-foundation.org> wrote:
> On Sun, 9 Feb 2025 at 10:40, Linus Torvalds
> <torvalds@...ux-foundation.org> wrote:
> >
> > It's *really* easy to miss the "oh, that changes X" when the only
> > little tiny sign of it is that "&" character inside the argument list,
> > and then the *normal* mental model is that arguments are arguments
> > *to* the function, not returns *from* the function.
>
> While I'm ranting, this is just another case of "C++ really got this
> very very wrong".
>
> C++ made pass-by-reference really easy, and removed the need for even
> that tiny marker in the caller.
>
> So then you really can't even visually see that "oh, that call changes
> its argument", and have to just know.
Or make a habit of appending '+ 0' to every argument :-)
>
> Linus
Powered by blists - more mailing lists