From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 54DA8388C022; Fri, 23 Jul 2021 19:41:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 54DA8388C022 From: "msebor at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/97548] [11 Regression] bogus -Wvla-parameter on a bound expression involving a parameter Date: Fri, 23 Jul 2021 19:41:41 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: diagnostic, patch X-Bugzilla-Severity: normal X-Bugzilla-Who: msebor at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: msebor at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.2 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: 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: Fri, 23 Jul 2021 19:41:41 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97548 --- Comment #6 from Martin Sebor --- The fix isn't very robust since it only handles redeclarations with VLA parameters that involve bounds that have the same name but not nontrivial expressions involving different names, like in this case: $ cat pr97548-c6.c && gcc -S -Wall pr97548-c6.c void g (int k, int [k + 1]); void g (int m, int [m + 1]) { } // bogus warning pr97548-c6.c:2:16: warning: argument 2 of type =E2=80=98int[m + 1]=E2=80=99= declared with mismatched bound =E2=80=98m + 1=E2=80=99 [-Wvla-parameter] 2 | void g (int m, int [m + 1]) { } // bogus warning | ^~~~~~~~~~~ pr97548-c6.c:1:16: note: previously declared as =E2=80=98int[k + 1]=E2=80= =99 with bound =E2=80=98k + 1=E2=80=99 1 | void g (int k, int [k + 1]); | ^~~~~~~~~~~=