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:
Leon Timmermans
Date:
April 24, 2018 12:56
Subject:
Re: [perl #132955] USE_CPLUSPLUS build broken in 5.27 blead and all5.26 stables
Message ID:
CAHhgV8iyp3m6vCGTvTUOkBWK7so2FopC-XHd5=bik+BJBtk0Zw@mail.gmail.com
On Tue, Apr 24, 2018 at 12:52 PM, Dave Mitchell <davem@iabyn.com> wrote:
> 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?

I would guess that making them EXTCONST again, but putting them inside
a START_EXTERN_C/END_EXTERN_C block would fix this.

Leon

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