develooper Front page | perl.perl5.porters | Postings from March 2013

[Win32] perl-5.17.10 fails to build with x64 mingw64 (gcc-4.7.0)

Thread Next
From:
sisyphus1
Date:
March 23, 2013 13:45
Subject:
[Win32] perl-5.17.10 fails to build with x64 mingw64 (gcc-4.7.0)
Message ID:
52819F3EF77C4F53B273B35AE49A2B84@OwnerPC311012
Hi,

The error:

In file included from ../hv.h:565:0,
                 from ../perl.h:3480,
                 from perllib.c:10:
../hv_func.h: In function 'U32 S_perl_hash_murmur3(const unsigned char*, 
const unsigned char*, STRLEN)':
../hv_func.h:395:20: error: cast from 'const unsigned char*' to 'long int' 
loses precision [-fpermissive]

Line 395 is:
    int i = -(long)ptr & 3;

Seems we can avoid the error if we change that line to:
    int i = -(IV)ptr & 3;

That change apparently works ok with both x86  32-bit int and x86 64-bit int 
(long long int) builds of perl-5.17.10, as well as with the x64 build of 
perl-5.17.10.

But is that the correct fix ?  Assigning what can be a 64-bit value to what 
can be (and usually is) a 32-bit type seems a bit dubious to me.

Cheers,
Rob 


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