From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id ADEEB383802C; Wed, 21 Apr 2021 17:44:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ADEEB383802C From: "f4bug at amsat dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/100190] New: warning on s390x: writing 1 byte into a region of size 0 [-Wstringop-overflow=] Date: Wed, 21 Apr 2021 17:44:32 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: f4bug at amsat dot org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2021 17:44:32 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100190 Bug ID: 100190 Summary: warning on s390x: writing 1 byte into a region of size 0 [-Wstringop-overflow=3D] 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 =3D s; 26=20 27 for (i =3D 0; i < n; i++) { 28 p[i] =3D c; 29 } 30=20 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 =E2=80=98memset=E2=80=99, inlined from =E2=80=98boot_setup=E2=80=99 at pc-bios/s390-ccw/main.c:18= 5:5, inlined from =E2=80=98main=E2=80=99 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 siz= e 0 [-Wstringop-overflow=3D] 28 | p[i] =3D c; | ~~~~~^~~ [*] https://gitlab.com/qemu-project/qemu/-/blob/master/pc-bios/s390-ccw/libc.h#= L22=