From: Thomas Huth <thuth@redhat.com>
To: "Philippe Mathieu-Daudé" <philmd@redhat.com>,
"Daniel P . Berrange" <berrange@redhat.com>,
"Stefano Garzarella" <sgarzare@redhat.com>,
"Christian Borntraeger" <borntraeger@de.ibm.com>,
"Cornelia Huck" <cohuck@redhat.com>,
"Janosch Frank" <frankja@linux.ibm.com>
Cc: qemu-s390x <qemu-s390x@nongnu.org>,
Richard Henderson <richard.henderson@linaro.org>,
qemu-devel <qemu-devel@nongnu.org>
Subject: Re: s390-ccw: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
Date: Thu, 22 Apr 2021 06:47:30 +0200 [thread overview]
Message-ID: <485773db-fca2-03ca-c6e8-90ef313fb8f1@redhat.com> (raw)
In-Reply-To: <4e327c80-8f5d-c848-b524-7f2c75255da4@redhat.com>
On 22/04/2021 06.18, Philippe Mathieu-Daudé wrote:
> Hi Thomas, Daniel, Stefano,
>
> Regarding the following warning (GCC 11 on Fedora 34):
>
> In file included from pc-bios/s390-ccw/main.c:11:
>
> In function ‘memset’,
>
> inlined from ‘boot_setup’ at pc-bios/s390-ccw/main.c:185:5,
>
> inlined from ‘main’ at pc-bios/s390-ccw/main.c:288:5:
>
> pc-bios/s390-ccw/libc.h:28:14: warning: writing 1 byte into a region of
> size 0 [-Wstringop-overflow=]
>
> 28 | p[i] = c;
>
> | ~~~~~^~~
>
> Daniel were right on IRC:
>
> danpb: it is from a call memset((char *)S390EP, 0, 6) where S390EP
> is just a constant address 0x10008
> danpb: the compiler doesn't now how big that is, so it seems to assume
> it is zero length
>
> This is a known GCC issue:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99578
> "gcc-11 -Warray-bounds or -Wstringop-overread warning when accessing a
> pointer from integer literal"
Hi Philippe,
thanks for following up with the gcc bugzilla!
... so the problem is that GCC thinks we're in fact dereferencing a NULL
pointer at offset 0x10008 here? Wow, that's ... crazy.
Not sure what to do now - wait for the bug to get resolved? Compile the
s390-ccw bios with -Wno-stringop-overread ? Add "volatiles" here and there
to hope that these silence the compiler warnings? ... I tend to wait for the
bug ticket to see whether the GCC folks change the behavior of the compiler
again, but I'm open for other suggestions.
Thomas
next prev parent reply other threads:[~2021-04-22 4:49 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-22 4:18 s390-ccw: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=] Philippe Mathieu-Daudé
2021-04-22 4:47 ` Thomas Huth [this message]
2021-04-22 6:04 ` Christian Borntraeger
2021-04-22 10:15 ` Daniel P. Berrangé
2021-04-22 10:30 ` Peter Maydell
2021-04-22 11:24 ` Philippe Mathieu-Daudé
2021-04-22 11:47 ` Thomas Huth
2021-04-22 12:41 ` Christian Borntraeger
2021-04-22 14:31 ` Philippe Mathieu-Daudé
2021-04-22 15:38 ` Thomas Huth
2021-04-22 15:43 ` Philippe Mathieu-Daudé
2021-04-22 15:52 ` Stefano Garzarella
2021-04-22 16:07 ` Thomas Huth
2021-04-22 16:54 ` Philippe Mathieu-Daudé
2021-04-23 6:40 ` Stefano Garzarella
2021-04-23 6:52 ` Christian Borntraeger
2021-04-23 7:57 ` Compiling the s390-ccw bios with clang (was: Re: s390-ccw: warning: writing 1 byte into a region of size 0) Thomas Huth
2021-04-23 8:05 ` Compiling the s390-ccw bios with clang Christian Borntraeger
2021-04-23 8:07 ` Compiling the s390-ccw bios with clang (was: Re: s390-ccw: warning: writing 1 byte into a region of size 0) Cornelia Huck
2021-04-23 8:22 ` Thomas Huth
2021-04-23 8:47 ` Daniel P. Berrangé
2021-04-23 8:52 ` Thomas Huth
2021-04-23 9:00 ` Daniel P. Berrangé
2021-04-22 11:48 ` s390-ccw: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=] Daniel P. Berrangé
2021-04-22 14:34 ` Philippe Mathieu-Daudé
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=485773db-fca2-03ca-c6e8-90ef313fb8f1@redhat.com \
--to=thuth@redhat.com \
--cc=berrange@redhat.com \
--cc=borntraeger@de.ibm.com \
--cc=cohuck@redhat.com \
--cc=frankja@linux.ibm.com \
--cc=philmd@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=sgarzare@redhat.com \
/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).