[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y8if47fU4C+06JNz@slm.duckdns.org>
Date: Wed, 18 Jan 2023 15:41:55 -1000
From: Tejun Heo <tj@...nel.org>
To: 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>,
David Laight <David.Laight@...lab.com>
Subject: Re: [PATCH] workqueue: fix enum type for gcc-13
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.
Thanks.
--
tejun
Powered by blists - more mailing lists