From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8445B3858C29; Mon, 5 Feb 2024 19:51:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8445B3858C29 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1707162661; bh=Ty8H7/4jaCCdd61zfX1rjErhe0dPYtGp6Qr/DbKQZOs=; h=From:To:Subject:Date:From; b=y45WKR9+Efa+a1luR5jfqDujfaS0xv+QNO4NwJCzPcRj9ukc7QHS8OP6Jz5ytWkC8 OKKtit4wkT+JYaCinaVi692MI98uyKJTMCkugio7ovXSCgv/BVc3jDf33JTU/5DE62 VKG7Kh9wXWTUUtkDUJLHHyEG5pln4g+MH6zf0vAE= From: "sjames at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/113776] New: [14 regression] postgresql-16.1 build failure with -Werror=vla in configure test Date: Mon, 05 Feb 2024 19:51:00 +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: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: sjames at gcc dot gnu.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 cc 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D113776 Bug ID: 113776 Summary: [14 regression] postgresql-16.1 build failure with -Werror=3Dvla in configure test Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: sjames at gcc dot gnu.org CC: jsm28 at gcc dot gnu.org Target Milestone: --- I'm not sure if this is an issue in the configure test that postgres is usi= ng. If so, I'll report it over there or to autoconf as appropriate. (I think pg is doing something wrong here anyway as it's using CFLAGS it te= sts for itself for all of its configure tests.) Anyway, I originally reported this downstream in Gentoo at https://bugs.gentoo.org/923804. pg fails to build like: ``` pg_collation.c:46:1: error: conflicting types for =E2=80=98CollationCreate= =E2=80=99; have =E2=80=98Oid(const char *, Oid, Oid, char, _Bool, int32, const char *,= const char *, const char *, const char *, const char *, _Bool, _Bool)=E2=80=99 {aka = =E2=80=98unsigned int(const char *, unsigned int, unsigned int, char, _Bool, int, const = char *, const char *, const char *, const char *, const char *, _Bool, _Bool)= =E2=80=99} 46 | CollationCreate(const char *collname, Oid collnamespace, | ^~~~~~~~~~~~~~~ In file included from pg_collation.c:25: ../../../src/include/catalog/pg_collation.h:88:17: note: previous declarati= on of =E2=80=98CollationCreate=E2=80=99 with type =E2=80=98Oid(const char *, O= id, Oid, char, bool,=20 int32, const char *, const char *, const char *, const char *, const char = *, bool, bool)=E2=80=99 {aka =E2=80=98unsigned int(const char *, unsigned int= , unsigned int,=20 char, unsigned char, int, const char *, const char *, const char *, const char *, const char *, unsigned char, unsigned char)=E2=80=99} 88 | extern Oid CollationCreate(const char *collname, Oid collnamespace, | ^~~~~~~~~~~~~~~ pg_collation.c: In function =E2=80=98CollationCreate=E2=80=99: pg_collation.c:207:48: error: passing argument 3 of =E2=80=98heap_form_tupl= e=E2=80=99 from incompatible pointer type [-Wincompatible-pointer-types] 207 | tup =3D heap_form_tuple(tupDesc, values, nulls); | ^~~~~ | | | _Bool * In file included from pg_collation.c:18: ../../../src/include/access/htup_details.h:715:87: note: expected =E2=80=98= bool *=E2=80=99 {aka =E2=80=98unsigned char *=E2=80=99} but argument is of type =E2=80=98_Bool *= =E2=80=99 715 | Da= tum *values, bool *isnull); ``` This turns out to be because of a configure test getting confused: ``` #include #ifndef bool "error: bool is not defined" #endif #ifndef false "error: false is not defined" #endif #if false "error: false is not 0" #endif #ifndef true "error: true is not defined" #endif #if true !=3D 1 "error: true is not 1" #endif #ifndef __bool_true_false_are_defined "error: __bool_true_false_are_defined is not defined" #endif struct s { _Bool s : 1; _Bool t; } s; char a[true =3D=3D 1 ? 1 : -1]; char b[false =3D=3D 0 ? 1 : -1]; char c[__bool_true_false_are_defined =3D=3D 1 ? 1 : -1]; char d[(bool)0.5 =3D=3D true ? 1 : -1]; /* See body of main program for 'e'. */ char f[(_Bool)0.0 =3D=3D false ? 1 : -1]; char g[true]; char h[sizeof(_Bool)]; char i[sizeof s.t]; enum { j =3D false, k =3D true, l =3D false * true, m =3D true * 256 }; /* The following fails for HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ _Bool n[m]; char o[sizeof n =3D=3D m * sizeof n[0] ? 1 : -1]; char p[-1 - (_Bool)0 < 0 && -1 - (bool)0 < 0 ? 1 : -1]; /* Catch a bug in an HP-UX C compiler. See http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html */ _Bool q =3D true; _Bool *pq =3D &q; int main() { bool e =3D &s; *pq |=3D q; *pq |=3D !q; /* Refer to every declared value, to avoid compiler optimizations. */ return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + != m + !n + !o + !p + !q + !pq); return 0; } ``` With -O2 -Werror=3Dvla, it recently started emitting: ``` :30:1: warning: variably modified 'd' at file scope 30 | char d[(bool)0.5 =3D=3D true ? 1 : -1]; | ^~~~ :30:1: error: ISO C90 forbids array 'd' whose size cannot be evalua= ted [-Werror=3Dvla] :32:1: warning: variably modified 'f' at file scope 32 | char f[(_Bool)0.0 =3D=3D false ? 1 : -1]; | ^~~~ :32:1: error: ISO C90 forbids array 'f' whose size cannot be evalua= ted [-Werror=3Dvla] cc1: some warnings being treated as errors Compiler returned: 1 ``` Is this intentional or not? GCC 13 doesn't error, nor does Clang 17.=