由于类型为 int
和 long
的数据在 ILP32 中从未真正加以区分,因此许多现有的代码会隐式或显式地假设它们可互换使用,并不加区分地进行使用。必须修改做出此假设的任何代码,使其可同时用于 ILP32 和 LP64。类型 int
和 long
在 ILP32 数据类型模型中均为 32 位,而类型 long
在 LP64 数据模型中则为 64 位。例如,
int waiting; long w_io; long w_swap; ... waiting = w_io + w_swap;
将生成以下警告:
warning: assignment of 64-bit integer to 32-bit integer