[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241015084714.GA1546610@thelio-3990X>
Date: Tue, 15 Oct 2024 01:47:14 -0700
From: Nathan Chancellor <nathan@...nel.org>
To: Arnd Bergmann <arnd@...db.de>
Cc: Aleksei Vetrov <vvvvvv@...gle.com>,
Shivamurthy Shastri <shivamurthy.shastri@...utronix.de>,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
Andrew Morton <akpm@...ux-foundation.org>,
Vlastimil Babka <vbabka@...e.cz>,
Matthew Wilcox <willy@...radead.org>,
Johannes Weiner <hannes@...xchg.org>,
Anna-Maria Gleixner <anna-maria@...utronix.de>,
Thomas Gleixner <tglx@...utronix.de>, llvm@...ts.linux.dev
Subject: Re: [PATCH] mm/vmstat: Fix -Wenum-enum-conversion warning in vmstat.h
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
Powered by blists - more mailing lists