Shutting up the warnings would be useful (for Perl) if I was convinced they were all false alarms, but I'm semi-convinced that one or more of them is the reason behind some traps I experience when I get close to allocating 4GB of virtual memory.

For Parrot, which effectively equates sizeof( INTVAL ) == sizeof( void* ) all over the show, I'm convinced that the configuration utility (that actually warns of the problem), is doing the wrong thing with respect to how it defines the fundemental typedefs.

Personally, I think that on windows the following typedefs for STRLEN, IV and UV should be used. And most (if not all) uses of int, I32, and U32 should dropped in favour of one if the 3 above.

#include <stdio.h> #include <stddef.h> typedef uintptr_t UV; typedef ptrdiff_t STRLEN; typedef intptr_t IV; #ifdef _WIN64 #define IS_WIN64 "" #else #define IS_WIN64 "not" #endif void main( void ){ printf( "_WIN64 is %s defined\n", IS_WIN64 ); printf( "MAX: %d\n", _INTEGRAL_MAX_BITS ); printf( "size_t is %d bytes\n", sizeof( size_t ) ); printf( "int is %d bytes\n", sizeof( int ) ); printf( "long is %d bytes\n", sizeof( long ) ); printf( "long long is %d bytes\n", sizeof( long long ) ); printf( "UV is %d bytes\n", sizeof( UV ) ); printf( "IV is %d bytes\n", sizeof( IV ) ); printf( "STRLEN is %d bytes\n", sizeof( STRLEN ) ); }

Compiled for 32 & 64-bit targets this produces:

C:\test>size_t.exe _WIN64 is not defined MAX: 64 size_t is 4 bytes int is 4 bytes long is 4 bytes long long is 8 bytes UV is 4 bytes IV is 4 bytes STRLEN is 4 bytes C:\test>size_t.exe _WIN64 is defined MAX: 64 size_t is 8 bytes int is 4 bytes long is 4 bytes long long is 8 bytes UV is 8 bytes IV is 8 bytes STRLEN is 8 bytes

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
RIP an inspiration; A true Folk's Guy

In reply to Re^4: [OT] LLP64 .v. LP64 portability by BrowserUk
in thread [OT] LLP64 .v. LP64 portability by BrowserUk

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.