[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAFhGd8qg5aeo34irrOQR7td1rjBVF2q4mDFV=Kbt=EmMUiTB_A@mail.gmail.com>
Date: Fri, 25 Aug 2023 15:49:31 -0700
From: Justin Stitt <justinstitt@...gle.com>
To: Wolfram Sang <wsa@...nel.org>,
Justin Stitt <justinstitt@...gle.com>,
Andi Shyti <andi.shyti@...nel.org>,
Nathan Chancellor <nathan@...nel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Tom Rix <trix@...hat.com>, linux-i2c@...r.kernel.org,
linux-kernel@...r.kernel.org, llvm@...ts.linux.dev
Subject: Re: [PATCH] i2c: pxa: fix clang -Wvoid-pointer-to-enum-cast warning
On Fri, Aug 25, 2023 at 3:17 PM Wolfram Sang <wsa@...nel.org> wrote:
>
>
> > Note: I think something like this may be more readable:
> > | *i2c_types = (enum pxa_i2c_types)(uintptr_t)of_id->data;
> >
> > Thoughts on this approach against the one present in this patch?
>
> On the one hand, I think this is more explicit and, thus, more readable.
> On the other hand, we still have the loss of precision, between the
> first and the second cast. Which gives it a bit of a "let's hide it
> somewhat so the compiler will be happy" feeling?
>
There was some discussion [1] wherein it was ultimately decided that
this warning should probably be turned off (contrary to what the title
of the GitHub issue says).
The state of these patches [2] is in some sort of limbo until I get a
patch in to disable the warning from W=1 (keep in mind GCC doesn't
even support this specific warning). I want to make the patch but am
seeking some guidance about what exactly is to be done -- I feel a
simply _demotion_ from W=1 to W=2 would suffice as CI robots aren't
testing w/ that AFAIK.
Nick, do you have anything to add here as we had previously discussed
this off-list/IRL.
[1]: https://github.com/ClangBuiltLinux/linux/issues/1910
[2]: https://lore.kernel.org/all/?q=b%3Apointer-to-enum-cast
Powered by blists - more mailing lists