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
Leon Timmermans
April 28, 2018 11:39
Re: [perl #132955] USE_CPLUSPLUS build broken in 5.27 blead and all5.26 stables
Message ID:
On Sat, Apr 28, 2018 at 12:09 PM, Dave Mitchell <> wrote:
> 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?

Reverting it literally requires reverting more of Aaron's C89 work
(I_STDDEF is eliminated and STANDARD_C mostly too). Just using the old
definition here  for VC++ may be the best solution for now.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About