Re: Why do we test a build using g++?

[email protected] ("Paul \"LeoNerd\" Evans") Tue, 30 Jun 2026 12:50:08 +0100
Newsgroups perl.perl5.porters
Message-ID <[email protected]>
On Mon, 29 Jun 2026 23:43:33 +0100
"Paul \"LeoNerd\" Evans" <[email protected]> wrote:

> Oooh that's a very exciting point. Let me try that one...


So, good points, bad points.

It technically works, and quiets the warning

  ./Configure -Dcc=3Dg++ -Dccflags=3D-Wno-missing-field-initializers ...

buuuut, it's a bit overkill, as TonyC points out:

  > I don't think the suppression belongs in ccflags because that will
  > suppress if for actual C++ XS code, but inline suppression like
  > GCC_DIAG_IGNORE*().

  https://github.com/Perl/perl5/pull/24508#discussion_r3495139906

I'll have a go at putting some GCC_DIAG_IGNORE() calls in the code,
though from the look of it my new locations are not the only place that
would need them. It seems without any of these additions we already
have a fair few of this category of warning, e.g.

  Socket.xs: In function =E2=80=98void XS_Socket_inet_aton(PerlInterpreter*=
, CV*)=E2=80=99:
  Socket.xs:784:35: warning: missing initializer for member =E2=80=98addrin=
fo::ai_family=E2=80=99 [-Wmissing-field-initializers]
    784 |         struct addrinfo hints =3D {0};
        |                                   ^
  Socket.xs:784:35: warning: missing initializer for member =E2=80=98addrin=
fo::ai_socktype=E2=80=99 [-Wmissing-field-initializers]
  Socket.xs:784:35: warning: missing initializer for member =E2=80=98addrin=
fo::ai_protocol=E2=80=99 [-Wmissing-field-initializers]
  Socket.xs:784:35: warning: missing initializer for member =E2=80=98addrin=
fo::ai_addrlen=E2=80=99 [-Wmissing-field-initializers]
  Socket.xs:784:35: warning: missing initializer for member =E2=80=98addrin=
fo::ai_addr=E2=80=99 [-Wmissing-field-initializers]
  Socket.xs:784:35: warning: missing initializer for member =E2=80=98addrin=
fo::ai_canonname=E2=80=99 [-Wmissing-field-initializers]
  Socket.xs:784:35: warning: missing initializer for member =E2=80=98addrin=
fo::ai_next=E2=80=99 [-Wmissing-field-initializers]

I don't know if it makes sense to scatter lots of GCC_DIAG_IGNORE calls
around every callsite, or instead to arrange for just one to be placed
somewhere toplevel in a .h file. Though that might be considered too
rude. Hrmm.

Thoughts continue...

--=20
Paul "LeoNerd" Evans

[email protected]
http://www.leonerd.org.uk/  |  https://metacpan.org/author/PEVANS