In this main function, I get an error message that I should not use %hu (format specifier for unsigned short), and that the type of unsigned short appears to be unsigned long. How could that be the case?
#include <stdio.h>
int main (void) {
unsigned short int a, b, c;
printf("sizeof short int - %hu bytes \n\n", sizeof(unsigned short int));
}
The shell output is:
warning: format specifies type
'unsigned short' but the argument has type
'unsigned long' [-Wformat]
...%hu bytes \n\n", sizeof(unsigned short int));
~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~
%lu