diff --git a/kernel/msg_q.c b/kernel/msg_q.c index b315cde80e..b3cd959d57 100644 --- a/kernel/msg_q.c +++ b/kernel/msg_q.c @@ -151,7 +151,7 @@ int z_impl_k_msgq_put(struct k_msgq *msgq, const void *data, k_timeout_t timeout /* put message in queue */ __ASSERT_NO_MSG(msgq->write_ptr >= msgq->buffer_start && msgq->write_ptr < msgq->buffer_end); - (void)memcpy(msgq->write_ptr, data, msgq->msg_size); + (void)memcpy(msgq->write_ptr, (char *)data, msgq->msg_size); msgq->write_ptr += msgq->msg_size; if (msgq->write_ptr == msgq->buffer_end) { msgq->write_ptr = msgq->buffer_start; @@ -227,7 +227,7 @@ int z_impl_k_msgq_get(struct k_msgq *msgq, void *data, k_timeout_t timeout) if (msgq->used_msgs > 0U) { /* take first available message from queue */ - (void)memcpy(data, msgq->read_ptr, msgq->msg_size); + (void)memcpy((char *)data, msgq->read_ptr, msgq->msg_size); msgq->read_ptr += msgq->msg_size; if (msgq->read_ptr == msgq->buffer_end) { msgq->read_ptr = msgq->buffer_start; @@ -242,7 +242,7 @@ int z_impl_k_msgq_get(struct k_msgq *msgq, void *data, k_timeout_t timeout) /* add thread's message to queue */ __ASSERT_NO_MSG(msgq->write_ptr >= msgq->buffer_start && msgq->write_ptr < msgq->buffer_end); - (void)memcpy(msgq->write_ptr, pending_thread->base.swap_data, + (void)memcpy(msgq->write_ptr, (char *)pending_thread->base.swap_data, msgq->msg_size); msgq->write_ptr += msgq->msg_size; if (msgq->write_ptr == msgq->buffer_end) { @@ -302,7 +302,7 @@ int z_impl_k_msgq_peek(struct k_msgq *msgq, void *data) if (msgq->used_msgs > 0U) { /* take first available message from queue */ - (void)memcpy(data, msgq->read_ptr, msgq->msg_size); + (void)memcpy((char *)data, msgq->read_ptr, msgq->msg_size); result = 0; } else { /* don't wait for a message to become available */