Menu

#58 sizeof(long)

closed-invalid
nobody
None
5
2008-07-07
2008-06-24
No

According to the GCC documentation, when compiling with -m64, sizeof(long) should be 8, but in MinGW-W64, it's 4.
I don't need long to be 8-byte, but I'd like to know what's right (i.e. how it will be in the future).

version (filename):
mingw-w64-bin_i686-mingw_20080613.zip

Discussion

  • Kai Tietz

    Kai Tietz - 2008-07-06
    • status: open --> closed-invalid
     
  • Kai Tietz

    Kai Tietz - 2008-07-06

    Logged In: YES
    user_id=1598680
    Originator: NO

    This is an abi difference between x86_64 and w64. For linux64 (and most other 64-bit unixes) the sizeof(long) is a scalar of 8 bytes. These platforms use the lp64 convention. For some strange reasons (IIUC for backward compatiblity with old windows sources) MS deceided to let the sizeof(long) having a scalar width of 4 bytes. This target uses the llp64 convention.

    I hope I could help you by this anwser.

    Cheers,
    Kai

     
  • Jan Lachnitt

    Jan Lachnitt - 2008-07-07

    Logged In: YES
    user_id=1956577
    Originator: YES

    Yes, you've helped me. Thanks, Jenda

     
  • Jan Lachnitt

    Jan Lachnitt - 2008-07-07
    • status: closed-invalid --> open-invalid
     
  • Jan Lachnitt

    Jan Lachnitt - 2008-07-07
    • status: open-invalid --> closed-invalid
     

Log in to post a comment.