Re: [PATCH] mm: Fix clang W=1 compiler warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 7 Feb 2025 at 19:33, Nathan Chancellor <nathan@xxxxxxxxxx> wrote:
>
> On Fri, Feb 07, 2025 at 07:11:08PM -0800, Linus Torvalds wrote:
> >
> > But not having clang-19, I can't see if this is a case of "this is so
> > rare that let's just avoid it", or "this is the case that causes the
> > most noise for every file build, but there are lots of other cases of
> > this".
>
> The diff to hide some of the really common ones:
>
> https://github.com/ClangBuiltLinux/linux/issues/2002#issuecomment-1970004069

Oh, ok, that's already more than I would have liked to see, and I do
think that the patch is not only bigger than I'd like, it makes the
code actively worse with adding random casts just to shut the compiler
up.

That is, of course, something that C++ people think is a good thing,
since they are used to their traditional NULL casting idiocy. But in
C, we have actual taste and grace.

So no, that warning is no good for the kernel.

> The build log with that:
>
> https://gist.github.com/nathanchance/971e5abeba504d3017cd6ed4517bbda6
>
> I looked at a number of them and none of them really seemed like bugs to
> me.

Yeah, those seem like more of the same: the kernel doing sane things,
using enum's the way they are meant to be used, and the compiler
warning is just simply plain wrong.

I will take your patch to move it to W=2.

Thanks,
                   Linus




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux