develooper Front page | perl.perl5.porters | Postings from April 2018

Re: [perl #132955] USE_CPLUSPLUS build broken in 5.27 blead and all5.26 stables

Thread Previous | Thread Next
From:
Dave Mitchell
Date:
April 24, 2018 10:52
Subject:
Re: [perl #132955] USE_CPLUSPLUS build broken in 5.27 blead and all5.26 stables
Message ID:
20180424105222.GN597@iabyn.com
On Mon, Apr 23, 2018 at 03:01:59PM +0100, Dave Mitchell wrote:
> > > I asked Jarkko about that commit. He suggested reverting it, but double checking that the whole thing then still builds also for Linux using g++.
> > > 
> > > Is anyone able to do that? (Presumably I could do it on dromedary, but wouldn't really know what I'm doing -- I've not built perl on anything UNIXy for many, many years.)
> > 
> > I'll have a look
> 
> Well, a simple revert caused g++ to break on linux:
> 
> In file included from POSIX.xs:19:0:
> ../../perl.h:6792:19: error: ‘const<unnamed union> PL_nan’, declared using unnamed type, is used but never defined [-fpermissive]
>  INFNAN_NV_U8_DECL PL_nan;
>                    ^~~~~~
> I haven't looked any further yet.

In more detail:

before jhi's C++ fix, the declaration of PL_nan expanded to:

    extern const union { NV nv; U8 u8[8]; } PL_nan;

and (under g++) gave this warning on the core *.c files:

    perl.h:6792:19: warning: unnamed type with no linkage used to declare variable ‘const<unnamed union> PL_nan’ with linkage

and this error on POSIX.i (when including perl.h):

    ../../perl.h:6792:19: error: ‘const<unnamed union> PL_nan’, declared using unnamed type, is used but never defined [-fpermissive]

jhi changed the declaration under C++ to expand to:

    extern "C" const union { NV nv; U8 u8[8]; } PL_nan;


and the warnings/errors went away on Linux, but broke Windows.

Does anyone with knowledge about C++ and linking have any clue what this
all means?


-- 
"You're so sadly neglected, and often ignored.
A poor second to Belgium, When going abroad."
    -- Monty Python, "Finland"

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About