Solaris 64-bit Developer's Guide

Do Not Assume int and long Are the Same Size

Because ints and longs were never really distinguished in ILP32, a lot of existing code uses them indiscriminately while implicitly or explicitly assuming that they are interchangeable. Any code that makes this assumption must be changed to work for both ILP32 and LP64. While an int and a long are both 32–bits in the ILP32 data model, in the LP64 data model, a long is 64–bits. For example,

int waiting;
long w_io;
long w_swap;
...
waiting = w_io + w_swap;

produces the warning:

warning: assignment of 64-bit integer to 32-bit integer