Fix cast align warning
@@ -425,7 +425,6 @@ int csp_can2_tx(const csp_route_t * ifroute, csp_packet_t *packet) {
int tx_count = 0;
uint32_t can_id = 0;
- uint8_t frame_buf[CAN_FRAME_SIZE] __attribute__((aligned(sizeof(uint32_t))));
uint8_t frame_buf_inp = 0;
uint8_t frame_buf_avail = CAN_FRAME_SIZE;
@@ -437,7 +436,11 @@ int csp_can2_tx(const csp_route_t * ifroute, csp_packet_t *packet) {
((1 & CFP2_BEGIN_MASK) << CFP2_BEGIN_OFFSET));
/* Pack the rest of the CSP header in the first 32-bit of data */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wcast-align"
+ uint8_t frame_buf[CAN_FRAME_SIZE] __attribute__((aligned(sizeof(uint32_t))));
uint32_t * header_extension = (uint32_t *) frame_buf;
+#pragma GCC diagnostic pop
*header_extension = (((packet->id.src & CFP2_SRC_MASK) << CFP2_SRC_OFFSET) |
((packet->id.dport & CFP2_DPORT_MASK) << CFP2_DPORT_OFFSET) |
