Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pointer cast to integer of different size in hv_func.h #12938

Closed
p5pRT opened this issue May 2, 2013 · 16 comments
Closed

Pointer cast to integer of different size in hv_func.h #12938

p5pRT opened this issue May 2, 2013 · 16 comments

Comments

@p5pRT
Copy link

p5pRT commented May 2, 2013

Migrated from rt.perl.org#117835 (status was 'resolved')

Searchable as RT117835$

@p5pRT
Copy link
Author

p5pRT commented May 2, 2013

From rmbarker.cpan@btinternet.com

Created by rmbarker.cpan@btinternet.com

When compiling perl, I get many warnings about the same line in
hv_func.h. The warnings would be silenced by the use of PTR2IV.

The attached patch, also changes the type of the variable on that
line, because it cast to STRLEN the first time it is used, and then
passed to a macro that assigns it to an int regardless.

Perl Info

Flags:
     category=core
     severity=low

Site configuration information for perl 5.17.12:

Configured by robin at Wed May  1 12:59:24 BST 2013.

Summary of my perl5 (revision 5 version 17 subversion 12) configuration:
   Commit id: 8257347d5f11b9bd1df15345570993538c8b1696
   Platform:
     osname=linux, osvers=3.0.0-32-generic, archname=i686-linux-64int
     uname='linux king-ubuntu 3.0.0-32-generic #51-ubuntu smp thu mar 21 
15:51:26 utc 2013 i686 athlon i386 gnulinux '
     config_args='-ders -Dcc=gcc -Dusedevel -Doptimize=-O2 -DDEBUGGING 
-Duse64bitint -Dman3dir=none -Dcf_email=rmbarker.cpan@btinternet.com'
     hint=recommended, useposix=true, d_sigaction=define
     useithreads=undef, usemultiplicity=undef
     useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
     use64bitint=define, use64bitall=undef, uselongdouble=undef
     usemymalloc=n, bincompat5005=undef
   Compiler:
     cc='gcc', ccflags ='-DDEBUGGING -fno-strict-aliasing -pipe 
-fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE 
-D_FILE_OFFSET_BITS=64',
     optimize='-O2 -g',
     cppflags='-DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector 
-I/usr/local/include'
     ccversion='', gccversion='4.6.4', gccosandvers=''
     intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678
     d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
     ivtype='long long', ivsize=8, nvtype='double', nvsize=8, 
Off_t='off_t', lseeksize=8
     alignbytes=4, prototype=define
   Linker and Libraries:
     ld='gcc', ldflags =' -fstack-protector -L/usr/local/lib'
     libpth=/usr/local/lib /lib/i386-linux-gnu /lib/../lib 
/usr/lib/i386-linux-gnu /usr/lib/../lib /lib /usr/lib
     libs=-lnsl -ldl -lm -lcrypt -lutil -lc
     perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
     libc=, so=so, useshrplib=false, libperl=libperl.a
     gnulibc_version='2.13'
   Dynamic Linking:
     dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
     cccdlflags='-fPIC', lddlflags='-shared -O2 -g -L/usr/local/lib 
-fstack-protector'

Locally applied patches:



@INC for perl 5.17.12:
     lib
     /usr/local/lib/perl5/site_perl/5.17.12/i686-linux-64int
     /usr/local/lib/perl5/site_perl/5.17.12
     /usr/local/lib/perl5/5.17.12/i686-linux-64int
     /usr/local/lib/perl5/5.17.12
     .


Environment for perl 5.17.12:
     HOME=/home/robin
     LANG=en_GB.UTF-8
     LANGUAGE=en_GB:en
     LD_LIBRARY_PATH (unset)
     LOGDIR (unset)
PATH=/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
     PERL_BADLANG (unset)
     SHELL=/bin/bash

@p5pRT
Copy link
Author

p5pRT commented May 2, 2013

From rmbarker.cpan@btinternet.com

0001-avoid-cast-from-pointer-to-integer-of-different-size.patch
From a3801c134954362fb394b6c1ffbefe0d1c045d4e Mon Sep 17 00:00:00 2001
From: Robin Barker <rmbarker@cpan.org>
Date: Wed, 1 May 2013 18:39:26 +0100
Subject: [PATCH 1/2] avoid cast from pointer to integer of different size

---
 hv_func.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/hv_func.h b/hv_func.h
index 0a66356..9dfe158 100644
--- a/hv_func.h
+++ b/hv_func.h
@@ -392,8 +392,8 @@ S_perl_hash_murmur3(const unsigned char * const seed, const unsigned char *ptr,
     /* This CPU does not handle unaligned word access */
 
     /* Consume enough so that the next data byte is word aligned */
-    int i = -(IV)ptr & 3;
-    if(i && (STRLEN)i <= len) {
+    STRLEN i = -PTR2IV(ptr) & 3;
+    if(i && i <= len) {
       MURMUR_DOBYTES(i, h1, carry, bytes_in_carry, ptr, len);
     }
 
-- 
1.7.5.4

@p5pRT
Copy link
Author

p5pRT commented May 2, 2013

From @demerphq

Sorry about that, probably my bad porting skills at fault. I will
apply your patch as soon as I can.

Yves

On 2 May 2013 12​:14, Robin Barker <perlbug-followup@​perl.org> wrote​:

# New Ticket Created by Robin Barker
# Please include the string​: [perl #117835]
# in the subject line of all future correspondence about this issue.
# <URL​: https://rt-archive.perl.org/perl5/Ticket/Display.html?id=117835 >

This is a bug report for perl from rmbarker.cpan@​btinternet.com,
generated with the help of perlbug 1.39 running under perl 5.17.12.

-----------------------------------------------------------------
[Please describe your issue here]

When compiling perl, I get many warnings about the same line in
hv_func.h. The warnings would be silenced by the use of PTR2IV.

The attached patch, also changes the type of the variable on that
line, because it cast to STRLEN the first time it is used, and then
passed to a macro that assigns it to an int regardless.

[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags​:
category=core
severity=low
---
Site configuration information for perl 5.17.12​:

Configured by robin at Wed May 1 12​:59​:24 BST 2013.

Summary of my perl5 (revision 5 version 17 subversion 12) configuration​:
Commit id​: 8257347d5f11b9bd1df15345570993538c8b1696
Platform​:
osname=linux, osvers=3.0.0-32-generic, archname=i686-linux-64int
uname='linux king-ubuntu 3.0.0-32-generic #51-ubuntu smp thu mar 21
15​:51​:26 utc 2013 i686 athlon i386 gnulinux '
config_args='-ders -Dcc=gcc -Dusedevel -Doptimize=-O2 -DDEBUGGING
-Duse64bitint -Dman3dir=none -Dcf_email=rmbarker.cpan@​btinternet.com'
hint=recommended, useposix=true, d_sigaction=define
useithreads=undef, usemultiplicity=undef
useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
use64bitint=define, use64bitall=undef, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler​:
cc='gcc', ccflags ='-DDEBUGGING -fno-strict-aliasing -pipe
-fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64',
optimize='-O2 -g',
cppflags='-DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector
-I/usr/local/include'
ccversion='', gccversion='4.6.4', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long long', ivsize=8, nvtype='double', nvsize=8,
Off_t='off_t', lseeksize=8
alignbytes=4, prototype=define
Linker and Libraries​:
ld='gcc', ldflags =' -fstack-protector -L/usr/local/lib'
libpth=/usr/local/lib /lib/i386-linux-gnu /lib/../lib
/usr/lib/i386-linux-gnu /usr/lib/../lib /lib /usr/lib
libs=-lnsl -ldl -lm -lcrypt -lutil -lc
perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
libc=, so=so, useshrplib=false, libperl=libperl.a
gnulibc_version='2.13'
Dynamic Linking​:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
cccdlflags='-fPIC', lddlflags='-shared -O2 -g -L/usr/local/lib
-fstack-protector'

Locally applied patches​:

---
@​INC for perl 5.17.12​:
lib
/usr/local/lib/perl5/site_perl/5.17.12/i686-linux-64int
/usr/local/lib/perl5/site_perl/5.17.12
/usr/local/lib/perl5/5.17.12/i686-linux-64int
/usr/local/lib/perl5/5.17.12
.

---
Environment for perl 5.17.12​:
HOME=/home/robin
LANG=en_GB.UTF-8
LANGUAGE=en_GB​:en
LD_LIBRARY_PATH (unset)
LOGDIR (unset)
PATH=/usr/lib/lightdm/lightdm​:/usr/local/sbin​:/usr/local/bin​:/usr/sbin​:/usr/bin​:/sbin​:/bin​:/usr/games
PERL_BADLANG (unset)
SHELL=/bin/bash

--
perl -Mre=debug -e "/just|another|perl|hacker/"

@p5pRT
Copy link
Author

p5pRT commented May 2, 2013

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented May 2, 2013

From @nwc10

On Thu, May 02, 2013 at 12​:23​:18PM +0200, demerphq wrote​:

Sorry about that, probably my bad porting skills at fault. I will
apply your patch as soon as I can.

It needs testing on Win64 first.

Nicholas Clark

@p5pRT
Copy link
Author

p5pRT commented May 2, 2013

From @demerphq

On 2 May 2013 12​:34, Nicholas Clark <nick@​ccl4.org> wrote​:

On Thu, May 02, 2013 at 12​:23​:18PM +0200, demerphq wrote​:

Sorry about that, probably my bad porting skills at fault. I will
apply your patch as soon as I can.

It needs testing on Win64 first.

Any reason Win64 is special in this regard?

Yves

--
perl -Mre=debug -e "/just|another|perl|hacker/"

@p5pRT
Copy link
Author

p5pRT commented May 2, 2013

From @nwc10

On Thu, May 02, 2013 at 12​:46​:30PM +0200, demerphq wrote​:

On 2 May 2013 12​:34, Nicholas Clark <nick@​ccl4.org> wrote​:

On Thu, May 02, 2013 at 12​:23​:18PM +0200, demerphq wrote​:

Sorry about that, probably my bad porting skills at fault. I will
apply your patch as soon as I can.

It needs testing on Win64 first.

Any reason Win64 is special in this regard?

Because the warning is not from your code. It's from a change made to your
code to fix a build failure on 64 bit Windows​:

https://rt-archive.perl.org/perl5/Ticket/Display.html?id=117687

So changing it has the potential to break their build.
[64 bit Windows is special because sizeof(void *) > sizeof(long)]

I'd spotted this warning a few days ago and had pushed a branch recently
(smoke-me/nicholas/rt-117687) with my second go at a fix. And I'm now
particularly wary of that line because the first thing that I thought would
work didn't. (Squashed the warning on 32 bit platforms, caused a warning on
64 bit platforms)

Also, I don't understand why it was a build *failure* on Win64, and not just
a warning. This whole thing is behaving strangely.

Nicholas Clark

@p5pRT
Copy link
Author

p5pRT commented May 2, 2013

From @demerphq

On 2 May 2013 13​:07, Nicholas Clark <nick@​ccl4.org> wrote​:

On Thu, May 02, 2013 at 12​:46​:30PM +0200, demerphq wrote​:

On 2 May 2013 12​:34, Nicholas Clark <nick@​ccl4.org> wrote​:

On Thu, May 02, 2013 at 12​:23​:18PM +0200, demerphq wrote​:

Sorry about that, probably my bad porting skills at fault. I will
apply your patch as soon as I can.

It needs testing on Win64 first.

Any reason Win64 is special in this regard?

Because the warning is not from your code. It's from a change made to your
code to fix a build failure on 64 bit Windows​:

https://rt-archive.perl.org/perl5/Ticket/Display.html?id=117687

So changing it has the potential to break their build.
[64 bit Windows is special because sizeof(void *) > sizeof(long)]

I'd spotted this warning a few days ago and had pushed a branch recently
(smoke-me/nicholas/rt-117687) with my second go at a fix. And I'm now
particularly wary of that line because the first thing that I thought would
work didn't. (Squashed the warning on 32 bit platforms, caused a warning on
64 bit platforms)

Also, I don't understand why it was a build *failure* on Win64, and not just
a warning. This whole thing is behaving strangely.

Oh. So maybe we should leave it one of our people who can easily test
and build on both? Er, assuming there is one?

Yves

--
perl -Mre=debug -e "/just|another|perl|hacker/"

@p5pRT
Copy link
Author

p5pRT commented May 2, 2013

From @steve-m-hay

demerphq wrote on 2013-05-02​:

On 2 May 2013 13​:07, Nicholas Clark <nick@​ccl4.org> wrote​:

On Thu, May 02, 2013 at 12​:46​:30PM +0200, demerphq wrote​:

On 2 May 2013 12​:34, Nicholas Clark <nick@​ccl4.org> wrote​:

On Thu, May 02, 2013 at 12​:23​:18PM +0200, demerphq wrote​:

Sorry about that, probably my bad porting skills at fault. I
will apply your patch as soon as I can.

It needs testing on Win64 first.

Any reason Win64 is special in this regard?

Because the warning is not from your code. It's from a change made
to your code to fix a build failure on 64 bit Windows​:

https://rt-archive.perl.org/perl5/Ticket/Display.html?id=117687

So changing it has the potential to break their build.
[64 bit Windows is special because sizeof(void *) > sizeof(long)]

I'd spotted this warning a few days ago and had pushed a branch
recently (smoke-me/nicholas/rt-117687) with my second go at a fix.
And
I'm now particularly wary of that line because the first thing that I
thought would work didn't. (Squashed the warning on 32 bit platforms,
caused a warning on 64 bit platforms)

Also, I don't understand why it was a build *failure* on Win64, and
not just a warning. This whole thing is behaving strangely.

Oh. So maybe we should leave it one of our people who can easily test
and build on both? Er, assuming there is one?

I'll give it whirl shortly... :-)

@p5pRT
Copy link
Author

p5pRT commented May 2, 2013

From @sisyphus

-----Original Message-----
From​: Nicholas Clark
Sent​: Thursday, May 02, 2013 9​:07 PM
To​: demerphq
Cc​: Perl5 Porteros ; bugs-bitbucket@​rt.perl.org
Subject​: Re​: [perl #117835] Pointer cast to integer of different size in
hv_func.h

On Thu, May 02, 2013 at 12​:46​:30PM +0200, demerphq wrote​:

On 2 May 2013 12​:34, Nicholas Clark <nick@​ccl4.org> wrote​:

On Thu, May 02, 2013 at 12​:23​:18PM +0200, demerphq wrote​:

Sorry about that, probably my bad porting skills at fault. I will
apply your patch as soon as I can.

It needs testing on Win64 first.

Any reason Win64 is special in this regard?

Because the warning is not from your code. It's from a change made to your
code to fix a build failure on 64 bit Windows​:

https://rt-archive.perl.org/perl5/Ticket/Display.html?id=117687

It was I that created that ticket.

I've tried Robin's patch on 5.17.11 - it's fine for me on Win64. (I haven't
tested Win32.)

So changing it has the potential to break their build.
[64 bit Windows is special because sizeof(void *) > sizeof(long)]

I'd spotted this warning a few days ago and had pushed a branch recently
(smoke-me/nicholas/rt-117687) with my second go at a fix. And I'm now
particularly wary of that line because the first thing that I thought
would
work didn't. (Squashed the warning on 32 bit platforms, caused a warning
on
64 bit platforms)

Also, I don't understand why it was a build *failure* on Win64, and not
just
a warning. This whole thing is behaving strangely.

It *is* strange.
I would think (without actually knowing) that kmx has checked to see that
5.17.10 and 5.17.11 build ok for x64 Strawberry Perl. If that's the case,
then he's obviously found no problem - as we've heard no complaint from him.
Strawberry Perl uses an older version of gcc (version 4.6.3) whereas I'm
using 4.7.0. I was therefore wondering whether the problem I faced was
specific to 4.7.0 (and maybe even later versions, too.)

I also use 4.7.0 for my 32-bit builds. There was no problem there ... but,
of course, 'IV' and 'long' are the same thing on 32-bit builds.

Cheers,
Rob

@p5pRT
Copy link
Author

p5pRT commented May 2, 2013

From @nwc10

On Thu, May 02, 2013 at 10​:33​:12PM +1000, sisyphus1@​optusnet.com.au wrote​:

-----Original Message-----
From​: Nicholas Clark
Sent​: Thursday, May 02, 2013 9​:07 PM
To​: demerphq
Cc​: Perl5 Porteros ; bugs-bitbucket@​rt.perl.org
Subject​: Re​: [perl #117835] Pointer cast to integer of different size in
hv_func.h

On Thu, May 02, 2013 at 12​:46​:30PM +0200, demerphq wrote​:

On 2 May 2013 12​:34, Nicholas Clark <nick@​ccl4.org> wrote​:

On Thu, May 02, 2013 at 12​:23​:18PM +0200, demerphq wrote​:

Sorry about that, probably my bad porting skills at fault. I will
apply your patch as soon as I can.

It needs testing on Win64 first.

Any reason Win64 is special in this regard?

Because the warning is not from your code. It's from a change made to your
code to fix a build failure on 64 bit Windows​:

https://rt-archive.perl.org/perl5/Ticket/Display.html?id=117687

It was I that created that ticket.

I've tried Robin's patch on 5.17.11 - it's fine for me on Win64. (I haven't
tested Win32.)

Cool, thanks. I hadn't yet asked you, because I was going to verify that the
automated smokers were happy with it first, before troubling a human, and
the branch was still in the queue.

So changing it has the potential to break their build.
[64 bit Windows is special because sizeof(void *) > sizeof(long)]

I'd spotted this warning a few days ago and had pushed a branch recently
(smoke-me/nicholas/rt-117687) with my second go at a fix. And I'm now
particularly wary of that line because the first thing that I thought
would
work didn't. (Squashed the warning on 32 bit platforms, caused a warning
on
64 bit platforms)

Also, I don't understand why it was a build *failure* on Win64, and not
just
a warning. This whole thing is behaving strangely.

It *is* strange.
I would think (without actually knowing) that kmx has checked to see that
5.17.10 and 5.17.11 build ok for x64 Strawberry Perl. If that's the case,
then he's obviously found no problem - as we've heard no complaint from him.
Strawberry Perl uses an older version of gcc (version 4.6.3) whereas I'm
using 4.7.0. I was therefore wondering whether the problem I faced was
specific to 4.7.0 (and maybe even later versions, too.)

I also use 4.7.0 for my 32-bit builds. There was no problem there ... but,
of course, 'IV' and 'long' are the same thing on 32-bit builds.

Well, they are by default. The warning is cropping up on *nix when one
runs Configure with -Duse64bitint on a 32 bit platform, so that IVs are
long longs.

Also, Robin's attached *patch* has the 1 line commit message
"avoid cast from pointer to integer of different size"

which doesn't reference the RT number (it can't - RT allocated the ticket
number after submission), and doesn't include the extra discussion in the
patch. I think the commit message should be something more like

commit 275227021431a7dbfb1c18e88a68a35ce0851161
Author​: Robin Barker <rmbarker@​cpan.org>
Date​: Wed May 1 18​:39​:26 2013 +0100

  Use PTR2IV() instead of casting a pointer to IV, to avoid warnings.
 
  The cast to IV was added to avoid problems on platforms where pointers are
  larger than longs. However, the change instead generates warnings on
  platforms where IVs are larger than pointers. Instead, use the PTR2IV()
  macro provided by perl.h to make everyone happy.
 
  Also change the type of the variable on that line, because it is cast to
  STRLEN the first time it is used, and then passed to a macro that assigns it
  to an int regardless.

Inline Patch
diff --git a/hv_func.h b/hv_func.h
index 0a66356..9dfe158 100644
--- a/hv_func.h
+++ b/hv_func.h
@@ -392,8 +392,8 @@ S_perl_hash_murmur3(const unsigned char * const seed, const 
     /* This CPU does not handle unaligned word access */
 
     /* Consume enough so that the next data byte is word aligned */
-    int i = -(IV)ptr & 3;
-    if(i && (STRLEN)i <= len) {
+    STRLEN i = -PTR2IV(ptr) & 3;
+    if(i && i <= len) {
       MURMUR_DOBYTES(i, h1, carry, bytes_in_carry, ptr, len);
     }
 
(which I've just pushed to smoke-me/nicholas/rt-117687 In case George's Win32 smoker is able to test this sooner than Steve on Win32\)

Nicholas Clark

@p5pRT
Copy link
Author

p5pRT commented May 2, 2013

From @steve-m-hay

Nicholas Clark wrote on 2013-05-02​:

On Thu, May 02, 2013 at 10​:33​:12PM +1000, sisyphus1@​optusnet.com.au
wrote​:
[...]

I've tried Robin's patch on 5.17.11 - it's fine for me on Win64. (I
haven't tested Win32.)

It works fine for me too, using MinGW 4.7.0 (32-bit native compiler),
MinGW-w64 4.7.1 (32->64-bit cross compiler) and MinGW-w64 4.7.1 (64-bit
native compiler) -- no errors and no warnings.

[...]

I also use 4.7.0 for my 32-bit builds. There was no problem there ...
but, of course, 'IV' and 'long' are the same thing on 32-bit builds.

Well, they are by default. The warning is cropping up on *nix when one
runs Configure with -Duse64bitint on a 32 bit platform, so that IVs
are long longs.

Also, Robin's attached *patch* has the 1 line commit message "avoid
cast from pointer to integer of different size"

which doesn't reference the RT number (it can't - RT allocated the
ticket number after submission), and doesn't include the extra
discussion in the patch. I think the commit message should be
something more like

commit 275227021431a7dbfb1c18e88a68a35ce0851161
Author​: Robin Barker <rmbarker@​cpan.org>
Date​: Wed May 1 18​:39​:26 2013 +0100

Use PTR2IV\(\) instead of casting a pointer to IV\, to avoid

warnings.

The cast to IV was added to avoid problems on platforms where
pointers are larger than longs\. However\, the change instead
generates warnings on platforms where IVs are larger than

pointers.

Instead\, use the PTR2IV\(\) macro provided by perl\.h to make

everyone

happy\.

Also change the type of the variable on that line\, because it is
cast to STRLEN the first time it is used\, and then passed to a

macro

that assigns it to an int regardless\.

diff --git a/hv_func.h b/hv_func.h
index 0a66356..9dfe158 100644
--- a/hv_func.h
+++ b/hv_func.h
@​@​ -392,8 +392,8 @​@​ S_perl_hash_murmur3(const unsigned char * const
seed, const
/* This CPU does not handle unaligned word access */

 /\* Consume enough so that the next data byte is word aligned \*/

- int i = -(IV)ptr & 3;
- if(i && (STRLEN)i <= len) {
+ STRLEN i = -PTR2IV(ptr) & 3;
+ if(i && i <= len) {
MURMUR_DOBYTES(i, h1, carry, bytes_in_carry, ptr, len);
}
(which I've just pushed to smoke-me/nicholas/rt-117687 In case
George's
Win32 smoker is able to test this sooner than Steve on Win32)

I've also tested with VC++ 2010 32-bit and 64-bit native compilers. No
errors or warnings from the 32-bit one, but the 64-bit one gets a new
warning​:

hv_func.h(397) : warning C4267​: 'initializing' : conversion from
'size_t' to 'int', possible loss of data

However, it already has several other warnings from that file​:

hv_func.h(264) : warning C4267​: 'initializing' : conversion from
'size_t' to 'U32', possible loss of data
hv_func.h(374) : warning C4267​: 'initializing' : conversion from
'size_t' to 'I32', possible loss of data
hv_func.h(438) : warning C4267​: 'initializing' : conversion from
'size_t' to 'int', possible loss of data
hv_func.h(488) : warning C4267​: 'initializing' : conversion from
'size_t' to 'U32', possible loss of data
hv_func.h(503) : warning C4267​: 'initializing' : conversion from
'size_t' to 'U32', possible loss of data

and generally gazillions of other warnings throughout the build which
the gcc 64-bit compilers don't do, so I'm inclined to turn a blind eye.

I haven't tried a 32-bit build with 64-bit-ints yet, but I will do later
unless you think it isn't worth the trouble.

PS. I also had Robin's other patch (RT #117837) in place throughout all
this, and that looks fine from here too, although I didn't see the
warnings that it is intended to fix originally anyway.

@p5pRT
Copy link
Author

p5pRT commented May 2, 2013

From @steve-m-hay

Steve Hay wrote on 2013-05-02​:

I haven't tried a 32-bit build with 64-bit-ints yet, but I will do
later unless you think it isn't worth the trouble.

I've done 64-bit-int builds with the 32-bit MinGW and VC++ 2010
compilers now, and they're both fine too.

@p5pRT
Copy link
Author

p5pRT commented May 5, 2013

From @nwc10

On Thu, May 02, 2013 at 06​:05​:58PM +0100, Steve Hay wrote​:

Steve Hay wrote on 2013-05-02​:

I haven't tried a 32-bit build with 64-bit-ints yet, but I will do
later unless you think it isn't worth the trouble.

I've done 64-bit-int builds with the 32-bit MinGW and VC++ 2010
compilers now, and they're both fine too.

Cool. The smoke tests all look clean.

I think that we should merge this fix to blead before v5.18.0

Whilst it's only a compiler warning fix, not a build breaker, it's clear
that this fix is safe (and better than what we have), and I think that
if we leave it as is, we're going to get more than one bug report about it
during the lifetime of maint-5.18

Hence I'll mark this ticket as a blocker and Ricardo can unmark it if he
feels I got it wrong.

Nicholas Clark

@p5pRT
Copy link
Author

p5pRT commented May 5, 2013

From @rjbs

* Nicholas Clark <nick@​ccl4.org> [2013-05-05T15​:27​:48]

Cool. The smoke tests all look clean.

I think that we should merge this fix to blead before v5.18.0

Yes.

--
rjbs

@p5pRT
Copy link
Author

p5pRT commented May 6, 2013

@nwc10 - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant