diff --git a/sw/airborne/modules/loggers/sdlog_chibios/msg_queue.c b/sw/airborne/modules/loggers/sdlog_chibios/msg_queue.c index bf01e472ae..0ddd782815 100644 --- a/sw/airborne/modules/loggers/sdlog_chibios/msg_queue.c +++ b/sw/airborne/modules/loggers/sdlog_chibios/msg_queue.c @@ -76,9 +76,11 @@ int32_t msgqueue_send(MsgQueue *que, void *msg, const uint16_t msgLen, int32_t msgqueue_send_timeout(MsgQueue *que, void *msg, const uint16_t msgLen, const MsgQueueUrgency urgency, const systime_t timout) { - const MsgPtrLen mpl = {.ptrOfst = (uint32_t) msg - (uint32_t) tlsf_get_heap_addr(&MSGQ_HEAP), - .len = msgLen - }; + // this code prevents compiler warning about a missing initializer of mpl + MsgPtrLen m; + m.len = msgLen; + m.ptrOfst = (uint32_t) msg - (uint32_t) tlsf_get_heap_addr(&MSGQ_HEAP); + const MsgPtrLen mpl = m; #if CH_DBG_ENABLE_CHECKS if (((uint32_t) msg < (uint32_t) tlsf_get_heap_addr(&MSGQ_HEAP)) ||