Greets,

I added this line to the soldier program from the Inline C cookbook.

use Inline Config => BUILD_NOISY => 1;

... and I exposed a bunch of warnings.  Here's one:

Soldier_396a.xs: In function `get_name':
Soldier_396a.xs:27: warning: cast to pointer from integer of different size

This is the offending line of code:

return ((Soldier*)SvIV(SvRV(obj)))->name;

My guess is that this is happening because sizeof(IV) is 8 bytes on my system, but memory addressing uses 32 bits. So the IV is overkill.

[begin excerpt from perlguts]

What is an "IV"?

Perl uses a special typedef IV which is a simple signed integer type that is guaranteed to be large enough to hold a pointer (as well as an integer). Additionally, there is the UV, which is simply an unsigned IV.

[end excerpt from perlguts]

I believe that the warning is harmless, but I'd like to get rid of it. I have twenty or thirty such lines in Search::Kinosearch::KSearch::ResultSet, and it would be nice if it compiled cleanly.

Possible?

Marvin Humphrey
Rectangular Research
http://www.rectangular.com/

Reply via email to