Bit-Vector-6.4 on Cygwin

S

sakagami

Hi,

I'm trying to install Bit-Vector-6.4 on WindowXP Professional Cygwin
Perl-5.8.7. (not ActivePerl) When I execute `make', gcc issued a lot
of warnings like this:

Vector.xs: In function `XS_Bit__Vector_Closure':
Vector.xs:3117: warning: cast to pointer from integer of different size
Vector.xs: In function `XS_Bit__Vector_Transpose':
Vector.xs:3157: warning: cast to pointer from integer of different size
Vector.xs:3158: warning: cast to pointer from integer of different si

I guess these warnings are harmless because `make test' all passed.
Can anyone back that up?

Regards,
 
S

Sisyphus

Hi,

I'm trying to install Bit-Vector-6.4 on WindowXP Professional Cygwin
Perl-5.8.7. (not ActivePerl) When I execute `make', gcc issued a lot
of warnings like this:

Vector.xs: In function `XS_Bit__Vector_Closure':
Vector.xs:3117: warning: cast to pointer from integer of different size
Vector.xs: In function `XS_Bit__Vector_Transpose':
Vector.xs:3157: warning: cast to pointer from integer of different size
Vector.xs:3158: warning: cast to pointer from integer of different si

I guess these warnings are harmless because `make test' all passed.
Can anyone back that up?

I don't think they matter .... but I wouldn't guarantee it :)

Are you on a 64-bit computer ?

I don't get those warnings (because my "pointer" and "integer" are of the
same size). Seems to me that somewhere in the BIT_VECTOR_OBJECT definition a
call to INT2PTR() might shut those warnings up. At a guess, try changing
line 71 of Vector.xs from:

(adr = (BitVector_Address)SvIV(hdl)) )

to:

(adr = INT2PTR(BitVector_Address,SvIV(hdl))) )

Then run:
make clean
perl Makefile.PL
make (and see if the warnings have disappeared)
make test
make install (if make test is still ok)

If that works, you might inform the author.

If it doesn't work, then maybe we need to look a little more closely.

Cheers,
Rob
 
S

Sakagami Hiroki

Hi,
I don't think they matter .... but I wouldn't guarantee it :)

Are you on a 64-bit computer ?

No, I'm on a 32bit machine.
I don't get those warnings (because my "pointer" and "integer" are of the

Hmm, due to the difference in compiler version?
I'm using gcc 3.4.4.
same size). Seems to me that somewhere in the BIT_VECTOR_OBJECT definition a
call to INT2PTR() might shut those warnings up. At a guess, try changing
line 71 of Vector.xs from:

(adr = (BitVector_Address)SvIV(hdl)) )

to:

(adr = INT2PTR(BitVector_Address,SvIV(hdl))) )

This change eliminates most of the warnings. Thank you.
But I still have these warnings:

Vector.xs: In function `XS_Bit__Vector_Create':
Vector.xs:241: warning: cast from pointer to integer of different size
Vector.xs:259: warning: cast from pointer to integer of different size
Vector.xs: In function `XS_Bit__Vector_new_Hex':
Vector.xs:302: warning: cast from pointer to integer of different size

line 241: handle = newSViv((IV)address);

Here, type of `address' is BitVector_Address which is
typedefed as `unsigned int *' (32bit), and IV seems to be
typedefed as `long long' (64bit).

After searching the reverse of INT2PTR in perl.h, try
changing (IV) to PTR2IV() wiped out all warnings!

Thanks a lot.
 
S

Sisyphus

..
..
No, I'm on a 32bit machine.

Me, too.
the

Hmm, due to the difference in compiler version?
I'm using gcc 3.4.4.

Actually, I'm also using gcc-3.4.4 .... though it's a Win32 (MinGW) port.
Still, I had always assumed that sizeof(IV) on a 32 bit machine would be 4
bytes, not 8. Apparently that's a *bad* assumption to be making.

..
..
This change eliminates most of the warnings. Thank you.
But I still have these warnings:

Vector.xs: In function `XS_Bit__Vector_Create':
Vector.xs:241: warning: cast from pointer to integer of different size
Vector.xs:259: warning: cast from pointer to integer of different size
Vector.xs: In function `XS_Bit__Vector_new_Hex':
Vector.xs:302: warning: cast from pointer to integer of different size

Gee ... these warnings could do with a bit of re-wording. I had to read them
(and your origianl post) about 7 times before I realised they were different
:)

..
..
After searching the reverse of INT2PTR in perl.h, try
changing (IV) to PTR2IV() wiped out all warnings!

If it's not too much trouble, send the author a note about this .... and/or
a patch.

Cheers,
Rob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,176
Messages
2,570,950
Members
47,503
Latest member
supremedee

Latest Threads

Top