I pack a handful of values inside a 64-bit integer at the end of a network packet. I extract this integer and then use bitwise ops to pull the packed individual values out. This is on 32-bit Android NDK code:
uint64_t footer = *(uint64_t*)(payload + payload_length - 8);
uint32_t v0 = footer & 0xFF; // 8 bits
uint32_t v1 = (footer >> 8) & 0xFFFF; // 16 bits
uint32_t v2 = (footer >> 24) & 0xFFFF; // 16 bits
uint32_t v3 = (footer >> 40) & 0xFFFFFF; // 24 bits
Accessing v2 or v3 seems to cause a crash, as if accessing the tail end of the 64-bit integer is causing a fault.