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

[perl #132955] USE_CPLUSPLUS build broken in 5.27 blead and all 5.26stables

Thread Next
From:
bulk88 via RT
Date:
April 27, 2018 12:54
Subject:
[perl #132955] USE_CPLUSPLUS build broken in 5.27 blead and all 5.26stables
Message ID:
rt-4.0.24-7547-1524833683-1632.132955-15-0@perl.org
On Tue, 24 Apr 2018 03:52:54 -0700, davem wrote:
> 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?

When I tried to write a cl-clang (visual c frontend for clang) perl port, I ran into a similar bug others caught at the time, that anonymous structs/unions aren't C++ portable. As I understand MS made anon types have a class name and therefore be extern, every other CC says that breaks C++ spec. See https://bugs.llvm.org/show_bug.cgi?id=24251

-- 
bulk88 ~ bulk88 at hotmail.com

---
via perlbug:  queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=132955

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