Is `memcpy((void *)dest, src, n)` with a `volatile` array safe?
问题 I have a buffer that I use for UART, which is declared this way: union Eusart_Buff { uint8_t b8[16]; uint16_t b9[16]; }; struct Eusart_Msg { uint8_t msg_posn; uint8_t msg_len; union Eusart_Buff buff; }; struct Eusart { struct Eusart_Msg tx; struct Eusart_Msg rx; }; extern volatile struct Eusart eusart; And here is the function that fills the buffer (which will be sent using interrupts): void eusart_msg_transmit (uint8_t n, void *msg) { if (!n) return; /* * The end of the previous transmission