From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A42A73858436; Tue, 10 Aug 2021 23:39:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A42A73858436 From: "nightstrike at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/101854] New: Invalid warning -Wstringop-overflow wrong argument Date: Tue, 10 Aug 2021 23:39:52 +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.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: nightstrike at gmail dot com 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: Tue, 10 Aug 2021 23:39:52 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101854 Bug ID: 101854 Summary: Invalid warning -Wstringop-overflow wrong argument Product: gcc Version: 11.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: nightstrike at gmail dot com Target Milestone: --- void f() { struct Weird { float a; // Comment out any member float b; // to silence the warning float c; float d; float e; }; struct Weird g(float const Q[2], float const null[6][8]) { return (struct Weird){0}; } float const q[2]; struct Weird ss =3D g(q, (void *)0); } $ gcc -c a.c a.c: In function 'f': a.c:14:27: warning: 'g' accessing 192 bytes in a region of size 8 [-Wstringop-overflow=3D] 14 | struct Weird ss =3D g(q, (void *)0); | ^~~~~~~~~~~~~~~ a.c:14:27: note: referencing argument 2 of type 'const float (*)[8]' a.c:9:22: note: in a call to function 'g' 9 | struct Weird g(float const Q[2], float const null[6][8]) { | ^ $ gcc -v Using built-in specs. COLLECT_GCC=3Dgcc COLLECT_LTO_WRAPPER=3D/tmp/bin/../libexec/gcc/x86_64-pc-linux-gnu/11.2.0/lt= o-wrapper Target: x86_64-pc-linux-gnu Configured with: ../src/gcc-11.2.0/configure --disable-nls --disable-multil= ib --enable-languages=3Dall --prefix=3D/tmp Thread model: posix Supported LTO compression algorithms: zlib gcc version 11.2.0 (GCC)=