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 28, 2018 10:09
Subject:
Re: [perl #132955] USE_CPLUSPLUS build broken in 5.27 blead and all5.26 stables
Message ID:
20180428100929.GD597@iabyn.com
On Fri, Apr 27, 2018 at 06:28:42PM +0100, Steve Hay via perl5-porters wrote:
> So now I see there is an obvious solution that I could employ (add
> /Zc:offsetof- to the compiler flags for this & later compilers), but
> I'm still puzzled exactly what the problem is and why it only affects
> Socket when there are so many other uses of STRUCT_OFFSET around the
> code.

Socket is the only non-core module (i.e. outside of ext/) which uses 
STRUCT_OFFSET. On unixy builds, cpan/ modules get passed a different
set of compiler options than core code (generally less strict compiler
warnings flags). Perhaps there's something similar for Windows builds?

Commit v5.27.5-31-g346712be0b modified core to assume stddef.h and
its features are always available. In particular it made this change to
perl.h:


-#if defined(STANDARD_C) && defined(I_STDDEF) && !defined(PERL_GCC_PEDANTIC)
-#   include <stddef.h>
-#   define STRUCT_OFFSET(s,m)  offsetof(s,m)
-#else
-#   define STRUCT_OFFSET(s,m)  (Size_t)(&(((s *)0)->m))
-#endif
+#include <stddef.h>
+#define STRUCT_OFFSET(s,m)  offsetof(s,m)

Perhaps that chunk should be reverted for now?




-- 
This is a great day for France!
    -- Nixon at Charles De Gaulle's funeral

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