I define an int like this:
int a;
When I want to lookup the size of this int, I have to use the format specifier %ld like this:
printf("int size is %ld\n", sizeof(a));
When I use %d as the format specifier, I get the following error:
foo.c:7:10: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long unsigned int’ [-Wformat=]
printf("int size is %d\n", sizeof(a));
The question is, why is the result of sizeof() defined as long unsigned int when the parameter of the function is an int?