Because sizeof
yields a value of type size_t
which is an unsigned type. In >
expression usual arithmetic conversions will convert -1
to an unsigned type which is the type of the >
result. The resulting value will be a huge positive value.
To get the expected behavior use:
(int) sizeof (int) > -1