Subject: Re: [PATCH v2 4/5] uaccess: Disable -Wshadow in __scoped_user_access()

From: David Laight <[email-masked]>
Date: Tue, 3 Mar 2026 09:12:12 +0000

On Mon, 2 Mar 2026 16:00:26 +0100
"Christophe Leroy (CS GROUP)" <[email-masked]> wrote:

> Le 02/03/2026 à 14:27, [email-masked] a écrit :
> > From: David Laight <[email-masked]>
> > 
> > -Wshadow is enabled by W=2 builds and __scoped_user_access() quite
> > deliberately creates a 'const' shadow of the 'user' address that
> > references a 'guard page' when the application passes a kernel pointer.
> > 
> > Signed-off-by: David Laight <[email-masked]>  
> 
> There is a problem with this patch:

(badly line-wrapped errors deleted)

It seems to need gcc 12.
(So Linus is in luck.)

Prior to gcc 12 the #pragma generated by _Pragma() act as the
controlled statement of the for () loop.

Trying to put the _Pragma() inside the for statement doesn't work at all.

	David