I don't understand why this code triggers off aliasing warning:
char buf[15];
*(uint16_t*) buf = 0x4040;
There is no any thinkable "alignments" within char type. And anyway, how do I do this in graceful way? So far I can't think of anything better than
char buf[15];
uint16_t foo = 0x4040;
memcpy(buf, &foo, 2);
The warning is this:
warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]