Severity Code Description Project File Line Suppression State Warning C4244 '=': conversion from '__int64' to 'I32', possible loss of data C:\Strawberry\perl\lib\CORE\inline.h 2165

Above is the warning we are getting.

When you go to link 2165 of inline.h this is line of code: PL_curstackinfo->si_cxsubix = cx - PL_curstackinfo->si_cxstack; Looking at PL_curstackinfoyou get (from cop.h):

struct stackinfo { AV * si_stack; /* stack for current + runlevel */ PERL_CONTEXT * si_cxstack; /* context stack for r +unlevel */ struct stackinfo * si_prev; struct stackinfo * si_next; I32 si_cxix; /* current conte +xt index */ I32 si_cxmax; /* m +aximum allocated index */ I32 si_cxsubix; /* to +pmost sub/eval/format */ I32 si_type; /* type of runle +vel */ I32 si_markoff; /* of +fset where markstack begins for us. + * currently used only with DEBUGGING, + * but not #ifdef-ed for bincompat */ #if defined DEBUGGING && !defined DEBUGGING_RE_ONLY /* high water mark: for checking if the stack was correctly extended / * tested for extension by each pp function */ SSize_t si_stack_hwm; #endif };

Here we can see that si_sxsubix is defined as an I32 which is typdef long I32. si_cxstack is a pointer to a PERL_CONTEXT. The key here is the fact it’s a pointer.

PERL_CONTEXT *cx

Going back to the line of code that is getting the warning:

PL_curstackinfo->si_cxsubix = cx - PL_curstackinfo->si_cxstack;

cx is going to be the address to a PERL_CONTEXT The problem is that when compiling for 64bit systems an address is going to be 64bits so now when doing the subtraction and putting it into the 32bit si_cxsubix there’s a conversation issue because the 64bit subtraction is being put into a 32bit value.


In reply to Re^2: C4244 Warning in inline.h file while using Win64 configuration by MubinSkt
in thread C4244 Warning in inline.h file while using Win64 configuration by MubinSkt

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.