My UART receive buffer is uint8_t rx[64], and a packet carries a 32-bit float at offset 3. I read it with float v = *(float *)&rx[3];. It has worked for months on a Cortex-M4, but a colleague says the cast breaks the strict aliasing rule, and on a Cortex-M0 board the same line ends in a HardFault.
What exactly is the rule being broken, and what is the correct, portable way to pull typed values out of a byte buffer?




