[lkml]   [2022]   [Feb]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [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 <> 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.


> 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

 \ /
  Last update: 2022-02-28 00:58    [W:0.083 / U:2.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site