[sr #111380] autoconf-2.72.90 C vs C++ test failure with Oracle Studio 12.6
Paul Eggert <[email protected]> Tue, 3 Feb 2026 22:39:10 -0500 (EST)
| Newsgroups | gmane.comp.sysutils.autoconf.bugs |
|---|---|
| Message-ID | <[email protected]> |
--8323329-1714636915-1770176350=:1153360
Content-Type: TEXT/plain; CHARSET=utf-8
Content-Transfer-Encoding: QUOTED-PRINTABLE
Content-Disposition: inline
URL:=0A <https://savannah.gnu.org/support/?111380>=0A=0A S=
ummary: autoconf-2.72.90 C vs C++ test failure with Oracle=0AStudio 12.6=0A=
Group: Autoconf=0A Submitter: eggert=0A =
Submitted: Tue 03 Feb 2026 07:39:06 PM PST=0A Pr=
iority: 5 - Unprioritized=0A Severity: 2 - Minor=0A =
Status: None=0A Privacy: Public=0A Ass=
igned to: None=0A Originator Email:=0A Open/Closed: Open=
=0A Discussion Lock: Unlocked=0A Operating System: Solaris=
=0A=0A=0A _______________________________________________________=0A=0AF=
ollow-up Comments:=0A=0A=0A------------------------------------------------=
-------=0ADate: Tue 03 Feb 2026 07:39:06 PM PST By: Paul Eggert <eggert>=0A=
I tested autoconf-2.72.90 on Solaris 10 sparc and Oracle Studio 12.6 (Sun=
=0AC/C++ 5.15) after building and installing GNU m4 1.4.19 myself, but with=
out=0Ausing any other GNU software. Test 324 (AC_C_FLEXIBLE_ARRAY_MEMBER) f=
ailed=0Awith hard-to-decipher diagnostics. As near as I can make out, the f=
ollowing=0Atest program is related to what makes the test case go haywire:=
=0A=0A #include <stdlib.h>=0A #include <stdio.h>=0A #include <stddef.h>=
=0A struct s { int n; double d[]; };=0A int=0A main (void)=0A {=0A i=
nt m =3D getchar ();=0A struct s *p =3D (struct s *) malloc (offsetof (s=
truct s, d)=0A + m * sizeof (double))=
;=0A p->d[0] =3D 0.0;=0A m =3D p->d !=3D (double *) NULL;=0A free =
(p);=0A return m;=0A }=0A=0AIf you compile this program with 'cc -S t.c=
' everything works; but if you=0Acompile it with 'CC -S t.c' it fails with =
the diagnostic:=0A=0A"t.c", line 4: Error: In this declaration "d" is of an=
incomplete type=0A"double[]".=0A=0AThis causes AC_C_FLEXIBLE_ARRAY_MEMBER =
to act differently depending on whether=0Ayou use C or C++, which causes te=
st/acc.at's=0AAT_CHECK_MACRO([AC_C_FLEXIBLE_ARRAY_MEMBER]) to fail because =
AT_CHECK_MACRO=0Ainsists that the C compiler behave like the C++ compiler.=
=0A=0AI don't know why AT_CHECK_MACRO insists that C++ behave like C. But p=
erhaps=0Athe testing regime shouldn't be calling=0AAT_CHECK_MACRO([AC_C_FLE=
XIBLE_ARRAY_MEMBER]), to avoid what appears to be a=0Afalse positive.=0A=0A=
=0A=0A=0A=0A=0A=0A _____________________________________________________=
__=0A=0AReply to this item at:=0A=0A <https://savannah.gnu.org/support/?11=
1380>=0A=0A_______________________________________________=0AMessage sent v=
ia Savannah=0Ahttps://savannah.gnu.org/=0A
--8323329-1714636915-1770176350=:1153360
Content-Type: APPLICATION/pgp-signature; name=signature.asc
-----BEGIN PGP SIGNATURE-----
iHUEABYIAB0WIQQk97aszIMMAvLLwm6qLAuaBUf3TgUCaYK/XgAKCRCqLAuaBUf3
TujUAP94tbaLxoF21MsoITUtZHZvpKZmgeQBKV6eM3qTWrakigD/cG/vJvhCuyI7
le2dACqr9XS4dVgKzA/ukrfX5SFLxAs=
=oTH3
-----END PGP SIGNATURE-----
--8323329-1714636915-1770176350=:1153360--