Solaris 7 64-bit Developer's Guide

sizeof() is an unsigned long

In LP64, sizeof()has the effective type of an unsigned long. Occasionally sizeof() is passed to a function expecting an argument of type int, or assigned or cast to an int. In some cases, this truncation might cause loss of data.


Example 4-11

long a[50];
unsigned char size = sizeof (a);

%
warning: 64-bit constant truncated to 8 bits by assignment
warning: initializer does not fit or is out of range: 0x190