I have this simple program
#include
int main(void)
{
unsigned int a = 0x120;
float b = 1.2;
printf(\"%X %X\\n\", b, a);
return 0;
}
Firstly, it's undefined behaviour to pass arguments to printf not matching the format specifiers.
Secondly, the float is promoted to double when passed to printf, so it's eight bytes instead of four. Which bytes get interpreted as the two unsigned values expected by the printf format depends on the order in which the arguments are pushed.