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

[email protected] (Sam James) Mon, 29 Jun 2026 23:07:12 +0100
Newsgroups perl.perl5.porters
Organization Gentoo
Message-ID <[email protected]>
--=-=-=
Content-Type: text/plain

"Paul \"LeoNerd\" Evans" <[email protected]> writes:

> TL;DR: We have some CI test builds that use -Dcc='g++', to test if we can
>   build perl using g++ as the "C" compiler. I wonder - why do we do this?
>   Perl is written in C, not C++, which is a different language. Can we
>   please not?

FWIW, I've always thought this was a bit strange and limiting, and I
thought it was a shame to see completely fine changes get reworked to
appease building-as-C++.
> [...]
>
> I'd like to propose that (if there isn't another valid reason that is
> stronger than our desire to use C99 features) we find another way to
> test if the perl headers are compatible with C++. For example, could we
> ship a tiny "helloworld.cpp" program that also pulls in <perl.h> and
> <XSUB.h> or somesuch? Or maybe we write a tiny XS extension in C++ and
> compiled with g++, to use for such testing purposes?
>

Both of those sound like good options.

> Or failing all of those; would we be able to test with g++ in some sort
> of mode where we can ask it to accept things that C99 considers valid.
> I don't know if this one is possible - see above under "I'm not a C++
> programmer", but I can't imagine we're the first and only people to
> ever run into this issue. Perhaps there's some way we can get around it?

sam

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEBBAEWCgCpFiEEJaa7iN2bdkxrVUHCc4QJ9SDfkZAFAmpC7JAbFIAAAAAABAAO
bWFudTIsMi41KzEuMTIsMiwyXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25z
Lm9wZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQyNUE2QkI4OEREOUI3NjRDNkI1NTQx
QzI3Mzg0MDlGNTIwREY5MTkwDxxzYW1AZ2VudG9vLm9yZwAKCRBzhAn1IN+RkIru
AQCqbAijEaAKhXL+sBcnKRjqOyygUUN7g+terNIjzsMVNQEAvziCL3a9Vc6butMH
4pSxqzHhlZ/XoBGZ6AF4hszrrg8=
=UV0e
-----END PGP SIGNATURE-----
--=-=-=--