From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C03F13836C4A; Fri, 5 Mar 2021 20:06:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C03F13836C4A From: "raj.khem at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/99420] New: New warning -Warray-parameter Date: Fri, 05 Mar 2021 20:06:35 +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: raj.khem 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: Fri, 05 Mar 2021 20:06:35 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99420 Bug ID: 99420 Summary: New warning -Warray-parameter Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: raj.khem at gmail dot com Target Milestone: --- Following code (reduced from nss ) exhibits new warning with gcc11 on x86_6= 4, this doe s not happen when both these externs are in one function e.g. foo(= ), its an expansion of PR_STATIC_ASSERT from nspr headers=20 #define PR_STATIC_ASSERT(condition) \ extern void pr_static_assert(int arg[(condition) ? 1 : -1]) my gcc version is gcc version 11.0.1 20210303 (experimental) (GCC)=20 a.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D void foo() { unsigned char bytes[(440 / 8) * 2]; extern void pr_static_assert(int arg[(sizeof(bytes) >=3D 32) ? 1 : -1]); } void bar() { extern void pr_static_assert(int arg[(((long unsigned int)-1) > (long unsigned int)1) ? 1 : -1]); } =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D $ x86_64-yoe-linux-musl-gcc -c a.c -Werror=3Darray-parameter=3D2 a.c: In function 'bar': a.c:8:38: error: argument 1 of type 'int[1]' with mismatched bound [-Werror=3Darray-parameter=3D] 8 | extern void pr_static_assert(int arg[(((long unsigned int)-1) > (long unsigned int)1) ? 1 : -1]); |=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20 ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.c:4:38: note: previously declared as 'int *' 4 | extern void pr_static_assert(int arg[(sizeof(bytes) >=3D 32) ? = 1 : -1]); |=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20 ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: some warnings being treated as errors=