public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/100190] New: warning on s390x: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
@ 2021-04-21 17:44 f4bug at amsat dot org
2021-04-21 19:30 ` [Bug c/100190] " pinskia at gcc dot gnu.org
2021-04-21 19:34 ` pinskia at gcc dot gnu.org
0 siblings, 2 replies; 3+ messages in thread
From: f4bug at amsat dot org @ 2021-04-21 17:44 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100190
Bug ID: 100190
Summary: warning on s390x: writing 1 byte into a region of size
0 [-Wstringop-overflow=]
Product: gcc
Version: 11.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: f4bug at amsat dot org
Target Milestone: ---
Using GCC 11.0.0 20210210 (Red Hat 11.0.0-0) on s390x host,
the following code [*] ...:
22 static inline void *memset(void *s, int c, size_t n)
23 {
24 size_t i;
25 unsigned char *p = s;
26
27 for (i = 0; i < n; i++) {
28 p[i] = c;
29 }
30
31 return s;
32 }
... generates the following warning:
$ make -C pc-bios/s390-ccw
CCAS start.o
CC main.o
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;
| ~~~~~^~~
[*]
https://gitlab.com/qemu-project/qemu/-/blob/master/pc-bios/s390-ccw/libc.h#L22
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c/100190] warning on s390x: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
2021-04-21 17:44 [Bug c/100190] New: warning on s390x: writing 1 byte into a region of size 0 [-Wstringop-overflow=] f4bug at amsat dot org
@ 2021-04-21 19:30 ` pinskia at gcc dot gnu.org
2021-04-21 19:34 ` pinskia at gcc dot gnu.org
1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-04-21 19:30 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100190
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
#define S390EP 0x10008
....
memset((char *)S390EP, 0, 6);
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c/100190] warning on s390x: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
2021-04-21 17:44 [Bug c/100190] New: warning on s390x: writing 1 byte into a region of size 0 [-Wstringop-overflow=] f4bug at amsat dot org
2021-04-21 19:30 ` [Bug c/100190] " pinskia at gcc dot gnu.org
@ 2021-04-21 19:34 ` pinskia at gcc dot gnu.org
1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-04-21 19:34 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100190
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |DUPLICATE
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Dup of bug 99578.
*** This bug has been marked as a duplicate of bug 99578 ***
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-04-21 19:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-21 17:44 [Bug c/100190] New: warning on s390x: writing 1 byte into a region of size 0 [-Wstringop-overflow=] f4bug at amsat dot org
2021-04-21 19:30 ` [Bug c/100190] " pinskia at gcc dot gnu.org
2021-04-21 19:34 ` pinskia at gcc dot gnu.org
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 read-only IMAP folder(s) and NNTP newsgroup(s).