@aburka ...Running it, printf will attempt to find a format string at location 72 of the memory. And crash.
There are helpers in GCC for printf, but currently they only check if *the static string* is a proper format and match the argument. They currently cannot check that the wrong type (a character instead of a string) was provided.
C++ is more peeky about types and would probably complain about not converting int to pointer, but still no explanation why 'H' is considered int.
@dryak that would require an intimate knowledge of the C language and its typing system (not trivial depending on one's background).
It's mostly a leak abstraction if the underneath machine code.
And a complete overhaul of how C is parsed in order to carry over the necessary extra information about type to detect this.
BUT!...