Would making plain int 64-bit break a lot of reasonable code?

后端 未结 8 2083
独厮守ぢ
独厮守ぢ 2021-02-19 03:12

Until recently, I\'d considered the decision by most systems implementors/vendors to keep plain int 32-bit even on 64-bit machines a sort of expedient wart. With mo

8条回答
  •  你的背包
    2021-02-19 03:49

    Not particularly. int is 64 bit on some 64 bit architectures (not x64).

    The standard does not actually guarantee you get 32 bit integers, just that (u)int32_t can hold one.

    Now if you are depending on int is the same size as ptrdiff_t you may be broken.

    Remember, C does not guarantee that the machine even is a binary machine.

提交回复
热议问题