Earlier quoted context omitted.
No, type punning via unions is a gcc extension. The standard only allows reading a value as the type it was written with or as char, and an access as char is only good for copying. If a char access used different bit order, that would be OK according to the standard because you couldn't tell unless you violated the standard. It seems every compiler will tolerate a memcpy for type punning, even though this isn't requi…
memcpy is legal and fine. To borrow the example from above: double d = 3.14; uint64_t i; memcpy(&i, &d, sizeof(d)); is perfectly kosher.
Aren't exact-bitwidth integer types optional even with C99 (let alone preceding versions of standard)?