From: Nathan Chancellor <nathan@kernel.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Aleksei Vetrov <vvvvvv@google.com>,
Shivamurthy Shastri <shivamurthy.shastri@linutronix.de>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
Andrew Morton <akpm@linux-foundation.org>,
Vlastimil Babka <vbabka@suse.cz>,
Matthew Wilcox <willy@infradead.org>,
Johannes Weiner <hannes@cmpxchg.org>,
Anna-Maria Gleixner <anna-maria@linutronix.de>,
Thomas Gleixner <tglx@linutronix.de>,
llvm@lists.linux.dev
Subject: Re: [PATCH] mm/vmstat: Fix -Wenum-enum-conversion warning in vmstat.h
Date: Tue, 15 Oct 2024 01:47:14 -0700 [thread overview]
Message-ID: <20241015084714.GA1546610@thelio-3990X> (raw)
In-Reply-To: <a2e8a76a-9fad-4e3e-bce1-bf8a9d180464@app.fastmail.com>
On Fri, Oct 11, 2024 at 02:05:00PM +0000, Arnd Bergmann wrote:
> I'm fairly sure I saw users mix up 'dma_data_direction' with
> 'dma_transfer_direction' and unrelated enum-enum mixups in
> amdgpu. There were probably more.
Yes, those have definitely happened but those are -Wenum-conversion, not
-Wenum-enum-conversion.
> I think what happened is that in clang-18 and earlier, the
> warning option caught mistakes of passing the wrong enum
> to a function and a few others, but it did not catch arithmetic
> operations between enums, so clang-19 now produces a lot more
> output than older versions, and I don't think we can
> control those independently.
A contrived example: https://godbolt.org/z/Ydx6rxsvb
We should be able to disable -Wenum-enum-conversion without impacting
the ability to catch the cases that you mentioned above. It also helps
that GCC supports -Wenum-conversion, but it does not seem like they have
an equivalent for -Wenum-enum-conversion.
Cheers,
Nathan
next prev parent reply other threads:[~2024-10-15 8:47 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-21 11:16 Shivamurthy Shastri
2024-06-21 18:13 ` Matthew Wilcox
2024-06-22 0:59 ` Andrew Morton
2024-10-07 20:13 ` Aleksei Vetrov
2024-10-08 0:51 ` Nathan Chancellor
2024-10-10 10:40 ` Aleksei Vetrov
2024-10-11 14:05 ` Arnd Bergmann
2024-10-15 8:47 ` Nathan Chancellor [this message]
2024-10-15 16:55 ` Aleksei Vetrov
2024-10-16 18:02 ` Nathan Chancellor
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=20241015084714.GA1546610@thelio-3990X \
--to=nathan@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=anna-maria@linutronix.de \
--cc=arnd@arndb.de \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=llvm@lists.linux.dev \
--cc=shivamurthy.shastri@linutronix.de \
--cc=tglx@linutronix.de \
--cc=vbabka@suse.cz \
--cc=vvvvvv@google.com \
--cc=willy@infradead.org \
/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