unsigned long DOES NOT work on SOLARIS

When I doing an assignment of mine, I found the output of my Mac and school Solaris system is different which should be the same.

After a series of testing, I found that unsigned long does not work on solaris. It works same as unsigned int.

Look at the C code here:

/* Author Name: Need-Being
   Modification Date: 17/08/11
   File Description: Test unsigned int and unsigned long */

int main()
{
        unsigned int a = 0;
        unsigned long b;

        a = ~a; /* Make it maximun of unsigned int */
        b = a;
        b += 1;

        printf("%u\t%lu\t%s\n", a , b, (a < b)?"Works":"Does not work");
        printf("%d\t%d\n", sizeof(unsigned int), sizeof(unsigned long));

        return 0;
}

The output should be “4294967295 4294967296 Works” and “4 8”.

However, the actual output is

$ a.out
4294967295 0 Does not work
4 4

The unsigned long behaves the same as unsigned int.

Test is processed on a sparc machine in my faculty:

$ uname -a
SunOS banshee 5.10 Generic_144488-17 sun4u sparc SUNW,Sun-Fire-V240