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=132955Thread Next