From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 694FF3851C0B; Thu, 22 Jul 2021 22:18:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 694FF3851C0B From: "jahns at dkrz dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/101585] New: Bad interaction of -fsanitize=undefined and -Wvla-parameters Date: Thu, 22 Jul 2021 22:18:23 +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.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jahns at dkrz dot de 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: Thu, 22 Jul 2021 22:18:23 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101585 Bug ID: 101585 Summary: Bad interaction of -fsanitize=3Dundefined and -Wvla-parameters Product: gcc Version: 11.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: jahns at dkrz dot de Target Milestone: --- The following source causes an incorrect warning with gcc 11.1.0 (sorry did= not have 11.1.1 available, it's not yet in spack): void a(long send_size_asize, int (*)[send_size_asize]); void a(long send_size_asize, int (*)[send_size_asize]) {} Compiling it with gcc-11.1 -c -Wall -Werror -fsanitize=3Dundefined mini.c results in mini.c:2:30: error: mismatch in bound 1 of argument 2 declared as 'int (*)[(send_size_asize) - 1]' []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wvla-par= ameter-Werror=3Dvla-parameter]8;;] 2 | void a(long send_size_asize, int (*)[send_size_asize]) {} | ^~~~~~~~~~~~~~~~~~~~~~~~ mini.c:1:30: note: previously declared as 'int (*)[(send_size_asize) - 1]' 1 | void a(long send_size_asize, int (*)[send_size_asize]); | ^~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors=