mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: "Arnd Bergmann" <arnd@kernel.org>,
	"Lai Jiangshan" <jiangshanlai@gmail.com>,
	"Richard Clark" <richard.xnu.clark@gmail.com>,
	"Jonathan Neuschäfer" <j.neuschaefer@gmx.net>,
	"Andrey Grodzovsky" <andrey.grodzovsky@amd.com>,
	"Tetsuo Handa" <penguin-kernel@i-love.sakura.ne.jp>,
	"linux-kernel@vger.kernel.org," <linux-kernel@vger.kernel.org>,
	"David Laight" <David.Laight@aculab.com>
Subject: Re: [PATCH] workqueue: fix enum type for gcc-13
Date: Wed, 18 Jan 2023 15:41:55 -1000	[thread overview]
Message-ID: <Y8if47fU4C+06JNz@slm.duckdns.org> (raw)
In-Reply-To: <a1d48420-862e-47e6-9435-462e23bb6be3@app.fastmail.com>

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

  reply	other threads:[~2023-01-19  1:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-17 16:40 Arnd Bergmann
2023-01-18  9:31 ` David Laight
2023-01-18 16:38   ` Tejun Heo
2023-01-18 20:32     ` Arnd Bergmann
2023-01-19  1:41       ` Tejun Heo [this message]
2023-01-19  9:21         ` David Laight
2023-05-08 15:23 ` Thierry Reding
2023-05-09  3:26 ` Lai Jiangshan
2023-05-21  2:40 ` Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y8if47fU4C+06JNz@slm.duckdns.org \
    --to=tj@kernel.org \
    --cc=David.Laight@aculab.com \
    --cc=andrey.grodzovsky@amd.com \
    --cc=arnd@arndb.de \
    --cc=arnd@kernel.org \
    --cc=j.neuschaefer@gmx.net \
    --cc=jiangshanlai@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=penguin-kernel@i-love.sakura.ne.jp \
    --cc=richard.xnu.clark@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®