lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 19 Jan 2023 09:21:06 +0000
From:   David Laight <David.Laight@...LAB.COM>
To:     'Tejun Heo' <tj@...nel.org>, Arnd Bergmann <arnd@...db.de>
CC:     Arnd Bergmann <arnd@...nel.org>,
        Lai Jiangshan <jiangshanlai@...il.com>,
        Richard Clark <richard.xnu.clark@...il.com>,
        Jonathan Neuschäfer <j.neuschaefer@....net>,
        "Andrey Grodzovsky" <andrey.grodzovsky@....com>,
        Tetsuo Handa <penguin-kernel@...ove.sakura.ne.jp>,
        "linux-kernel@...r.kernel.org," <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] workqueue: fix enum type for gcc-13

From: Tejun Heo
> Sent: 19 January 2023 01:42
> 
> On Wed, Jan 18, 2023 at 09:32:45PM +0100, Arnd Bergmann wrote:
> > the enum type has to be compatible with 'long long' because
> > anything shorter would not fit both -1 and -1u (UINT_MAX).
> > A and B were both signed types to match the signedness of the
> > enum type, but A was actually a 32-bit integer since that is
> > sufficient, while B was also a 64-bit type since it exceeds
> > INT_MAX. Now they are both the same type.
> 
> Yeah, the new behavior makes total sense.
> 
> > I don't think there is a chance they will revert to the old behavior,
> > though we could try asking for an command line flag to warn about
> > cases where this changes code generation.
> 
> but the way that it's transitioning doesn't really make sense to me. We do
> phase out support for old compilers, so it isn't that difficult to manage
> this transition smoothly - add a compat option in the new versions, switch
> code later once old compilers are phased out and drop the compat flag.
> 
> The way it's currently done causes situations which can't be handled
> logically - we end up having to regroup enums based on their value range
> rather than the logical type they need to be because there's no way to
> override the enum type on older compilers.

Didn't someone say that either C++ or C23 defines a syntax to explicitly
set the type of the enum.
IIRC gcc-13 doesn't support that.

If gcc-13 supported explicit setting of the type and also generated a
warn/error enum with 'large' values when the type wasn't specified
(ie where the gcc extension had been used) then at least there would
be no obscure surprises.
Getting an old gcc to ignore the type is easy.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ