If one needs to compare int x with unsigned int y which is safer/better/nicer in C99 and with gcc 4.4+:
int x
unsigned int y
C99
gcc 4.4+
Safest is to check that the number is in range before casting:
if (x >= 0 && ((unsigned int)x) == y)