You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Marcus Doemling <ma...@fysix.com> on 2006/11/14 18:23:04 UTC

Compiling under Perl configured with 64 bit integers (use64bitint)

Hi Gerald.

I ran into a problem when trying to compile Embperl 1.3.6 on a system
that was 32 bit, but had Perl compiled with the use64bitint flag.
I also found the solution and thought I should share this. It may also
affect Embperl 2.

During make I got a lot of the following errors:

  warning: cast to pointer from integer of different size

Most of them are harmless, but at least one of them caused a real problem.
The one causing the problem is triggered by the following line (line 922)
in epcmd.c:

  sprintf (sSubCode, " HTML::Embperl::ProcessSub (%ld, %d, %d)", (IV)r 
-> Buf.pFile, nSubPos, r -> Buf.nBlockNo) ;

I found the problem occurs by (r -> Buf.pFile) being cast into an (IV) 
which sprintf apparently
prints in a wrong way so that as a consequence [$ sub $] no longer works.

Here is my fix. instead of casting it into IV, I used an I32 changing 
the line to:

  sprintf (sSubCode, " HTML::Embperl::ProcessSub (%ld, %d, %d)", (I32)r 
-> Buf.pFile, nSubPos, r -> Buf.nBlockNo) ;

This fixed it.

Hope this is useful info.

Best,
Marcus



---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org