linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Jakub Kicinski <kuba@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Bart Van Assche <bvanassche@acm.org>,
	linux-mm@kvack.org, Ivan Shapovalov <intelfx@intelfx.name>,
	Vlastimil Babka <vbabka@suse.cz>,
	David Laight <david.laight@aculab.com>,
	Pasha Tatashin <pasha.tatashin@soleen.com>,
	David Rientjes <rientjes@google.com>,
	David Hildenbrand <david@redhat.com>,
	Kaiyang Zhao <kaiyang2@cs.cmu.edu>,
	Joel Granados <joel.granados@kernel.org>,
	Sourav Panda <souravpanda@google.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	llvm@lists.linux.dev
Subject: Re: [PATCH] mm: Fix clang W=1 compiler warnings
Date: Fri, 7 Feb 2025 20:33:51 -0700	[thread overview]
Message-ID: <20250208033351.GB3305705@ax162> (raw)
In-Reply-To: <CAHk-=wjMux0w49bTdSbC3DOoc9FRctDrRvaqFUS4KFTmkbtKWg@mail.gmail.com>

On Fri, Feb 07, 2025 at 07:11:08PM -0800, Linus Torvalds wrote:
> That said, we may not have *many* of those enum cases in the kernel
> (and we do tend to have a history of using long series of '#define'
> sequences to do these constants), so maybe the warning is acceptable
> if it's a case of "this is literally the *only* one in the kernel".
> 
> 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".

When this warning was turned on for C in clang-19 (it was C++ only prior
to that IIRC), it was extremely noisy. Some of that was due to the
warning occurring in headers that are included everywhere such as these
couple of ones but even hiding the big ones, there were still a bunch of
locations that triggered it (I did not do the best at hiding all of the
header ones because I had given up trying to make leaving the warning on
for the default build at that point).

The diff to hide some of the really common ones:

https://github.com/ClangBuiltLinux/linux/issues/2002#issuecomment-1970004069

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.

Cheers,
Nathan


  reply	other threads:[~2025-02-08  3:34 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-31 19:12 Bart Van Assche
2025-02-03 13:32 ` Vlastimil Babka
2025-02-08  0:49 ` Jakub Kicinski
2025-02-08  1:01   ` Linus Torvalds
2025-02-08  1:38     ` Jakub Kicinski
2025-02-08  2:18       ` Nathan Chancellor
2025-02-08  3:11       ` Linus Torvalds
2025-02-08  3:33         ` Nathan Chancellor [this message]
2025-02-08  3:49           ` Linus Torvalds
2025-02-08  4:24             ` Linus Torvalds
2025-02-10 18:33               ` Jakub Kicinski
2025-02-08  2:55     ` Bart Van Assche
2025-02-08  3:22       ` Linus Torvalds
2025-02-08  3:30         ` Bart Van Assche
2025-02-08 10:28 ` Matthew Wilcox
2025-02-11 14:34   ` Vlastimil Babka
2025-02-11 18:48     ` Bart Van Assche
2025-02-11 19:25       ` Matthew Wilcox

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=20250208033351.GB3305705@ax162 \
    --to=nathan@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=bvanassche@acm.org \
    --cc=david.laight@aculab.com \
    --cc=david@redhat.com \
    --cc=hannes@cmpxchg.org \
    --cc=intelfx@intelfx.name \
    --cc=joel.granados@kernel.org \
    --cc=kaiyang2@cs.cmu.edu \
    --cc=kuba@kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=llvm@lists.linux.dev \
    --cc=pasha.tatashin@soleen.com \
    --cc=rientjes@google.com \
    --cc=souravpanda@google.com \
    --cc=torvalds@linux-foundation.org \
    --cc=vbabka@suse.cz \
    /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