[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aUT54I0fD0aqBVyw@stanley.mountain>
Date: Fri, 19 Dec 2025 10:08:16 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: David Laight <david.laight.linux@...il.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
Vincent Mailhol <mailhol@...nel.org>,
Nathan Chancellor <nathan@...nel.org>,
Nicolas Schier <nsc@...nel.org>,
Nick Desaulniers <nick.desaulniers+lkml@...il.com>,
Bill Wendling <morbo@...gle.com>,
Justin Stitt <justinstitt@...gle.com>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>,
Thomas Zimmermann <tzimmermann@...e.de>,
David Airlie <airlied@...il.com>, Simona Vetter <simona@...ll.ch>,
Chris Mason <clm@...com>, David Sterba <dsterba@...e.com>,
linux-kbuild@...r.kernel.org, linux-sparse@...r.kernel.org,
linux-kernel@...r.kernel.org, llvm@...ts.linux.dev,
dri-devel@...ts.freedesktop.org, linux-btrfs@...r.kernel.org
Subject: Re: [PATCH 0/2] kbuild: remove gcc's -Wtype-limits
On Thu, Dec 18, 2025 at 10:06:51PM +0000, David Laight wrote:
> On Fri, 19 Dec 2025 08:34:05 +1200
> Linus Torvalds <torvalds@...ux-foundation.org> wrote:
>
> > On Fri, 19 Dec 2025 at 08:26, David Laight <david.laight.linux@...il.com> wrote:
> > >
> > > One possibility is to conditionally add _Pragma()
> >
> > No. That compiler warning is pure and utter garbage. I have pointed it
> > out fopr *years*, and compiler people don't get it.
> >
> > So that warning just needs to die. It's shit. It's wrong.
>
> True - especially for code like:
> if (x < 0 || x > limit)
> return ...
> where the code is correct even with 'accidental' conversion of a
> negative signed value to a large unsigned one.
>
> clang seems to have a dozen similar warnings, all of which are a PITA
> for kernel code - like rejecting !(4 << 16).
In this example is 4 a literal or do we at least know that 4 is
non-zero?
I really thought I had a check for that in Smatch but I guess I
don't...
regards,
dan carpenter
Powered by blists - more mailing lists