[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <72ff1b04-4f37-9851-a6e6-aded72b46c83@linaro.org>
Date: Sun, 27 Feb 2022 17:57:52 -0600
From: Alex Elder <elder@...aro.org>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Arnd Bergmann <arnd@...nel.org>,
Linux Kbuild mailing list <linux-kbuild@...r.kernel.org>,
Arnd Bergmann <arnd@...db.de>,
Masahiro Yamada <masahiroy@...nel.org>, llvm@...ts.linux.dev,
Jonathan Corbet <corbet@....net>,
Federico Vaga <federico.vaga@...a.pv.it>,
Alex Shi <alexs@...nel.org>, Hu Haowen <src.res@...il.cn>,
Michal Marek <michal.lkml@...kovi.net>,
Nick Desaulniers <ndesaulniers@...gle.com>,
"open list:DOCUMENTATION" <linux-doc@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-doc-tw-discuss@...ts.sourceforge.net,
Linux ARM <linux-arm-kernel@...ts.infradead.org>,
intel-gfx <intel-gfx@...ts.freedesktop.org>,
dri-devel <dri-devel@...ts.freedesktop.org>,
greybus-dev@...ts.linaro.org, linux-staging@...ts.linux.dev,
linux-btrfs <linux-btrfs@...r.kernel.org>
Subject: Re: [greybus-dev] [PATCH] Kbuild: remove -std=gnu89 from compiler
arguments
On 2/27/22 5:11 PM, Linus Torvalds wrote:
> On Sun, Feb 27, 2022 at 3:04 PM Alex Elder <elder@...aro.org> wrote:
>>
>> Glancing at the Greybus code, I don't believe there's any
>> reason it needs to shift a negative value. Such warnings
>> could be fixed by making certain variables unsigned, for
>> example.
>
> As mentioned in the original thread, making things unsigned actually
> is likely to introduce bugs and make things worse.
Understood. What I meant is that the shifts were producing
single-bit masks from plain int values that range from 0 to 10
or something (in a for loop). Looking again though, that it's
not so simple. Regardless, your point about the warning is
good and I won't plan to "fix" this.
Thanks.
-Alex
>
> The warning is simply bogus, and the fact that it was enabled by
> -Wextra in gcc for std=gnu99 and up was a mistake that looks likely to
> be fixed in gcc.
>
> So don't try to "fix" the code to make any possible warnings go away.
> You may just make things worse.
>
> (That is often true in general for the more esoteric warnings, but in
> this case it's just painfully more obvious).
>
> Linus
Powered by blists - more mailing lists