美文网首页
Datatype LP64 ILP64 LLP64 ILP32

Datatype LP64 ILP64 LLP64 ILP32

作者: 404d67ac8c12 | 来源:发表于2019-02-14 15:46 被阅读0次

    现今所有64位的类Unix平台均使用LP64数据模型,而64位Windows使用LLP64数据模型。

    Datatype LP64 ILP64 LLP64 ILP32 LP32
    char 8 8 8 8 8
    short 16 16 16 16 16
    int 32 64 32 32 16
    long 64 64 32 32 32
    long long 64 64 64 64 64
    pointer 64 64 64 32 32

    所以,在 Linux 中做 Windows 的交叉编译时,需要注意 MinGW 是 LLP64,long 就是 32 位。

    参考
    64-Bit Programming Models: Why LP64?

    相关文章

      网友评论

          本文标题:Datatype LP64 ILP64 LLP64 ILP32

          本文链接:https://www.haomeiwen.com/subject/yameeqtx.html