linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Helge Deller <deller@gmx.de>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	linux-kernel@vger.kernel.org
Cc: sparclinux@vger.kernel.org, linux-parisc@vger.kernel.org,
	linux-hwmon@vger.kernel.org, intel-xe@lists.freedesktop.org
Subject: Re: Build regressions/improvements in v6.8-rc2
Date: Tue, 30 Jan 2024 08:38:10 -0800	[thread overview]
Message-ID: <a1fe7c95-a583-424b-9902-735462df5168@roeck-us.net> (raw)
In-Reply-To: <90cd0f1a-29c0-4c6f-9efd-92b69da194c0@gmx.de>

On 1/29/24 23:49, Helge Deller wrote:
> On 1/29/24 15:58, Guenter Roeck wrote:
>> On 1/29/24 03:06, Geert Uytterhoeven wrote:
>> [ ... ]
>>> parisc-gcc1[23]/parisc-{allmod,def}config
>>>
>>>    + /kisskb/src/drivers/hwmon/pc87360.c: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=]:  => 383:51
>>>
>>
>> The "fix" for this problem would be similar to commit 4265eb062a73 ("hwmon: (pc87360)
>> Bounds check data->innr usage"). The change would be something like
>>
>> -               for (i = 0; i < data->tempnr; i++) {
>> +               for (i = 0; i < min(data->tempnr, ARRAY_SIZE(data->temp_max)); i++) {
>>
>> but that would be purely random because the loop accesses several arrays
>> indexed with i, and tempnr is never >= ARRAY_SIZE(data->temp_max).
>> I kind of resist making such changes to the code just because the compiler
>> is clueless.
> 
> I agree with your analysis.
> But I'm wondering why this warning just seem to appear on parisc.
> I would expect gcc on other platforms to complain as well ?!?
> 

I have seen that problem before, where specifically gcc for x86 doesn't even
generate warnings for really problematic code but gcc for other architectures
does. I never found out what causes this. Don't ask me for examples, I didn't
write it down, forgot specifics, and just accepted it as "one of those things".

Guenter


  parent reply	other threads:[~2024-01-30 16:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-29  1:13 Linux 6.8-rc2 Linus Torvalds
2024-01-29 10:49 ` Build regressions/improvements in v6.8-rc2 Geert Uytterhoeven
2024-01-29 11:06   ` Geert Uytterhoeven
2024-01-29 14:58     ` Guenter Roeck
2024-01-30  7:49       ` Helge Deller
2024-01-30  8:02         ` Sam James
2024-01-30 16:38         ` Guenter Roeck [this message]
2024-01-29 19:39 ` Linux 6.8-rc2 Guenter Roeck

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=a1fe7c95-a583-424b-9902-735462df5168@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=deller@gmx.de \
    --cc=geert@linux-m68k.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-parisc@vger.kernel.org \
    --cc=sparclinux@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).