From 7348cb50c2f1f65b6372447f98c0eb7281c7fa0e Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Wed, 24 Mar 2021 12:45:01 -0700 Subject: [PATCH] kernel: fix XCC compilation with k_poll event initializer XCC (which is based on GCC 4.2) needs the initializer of one of the union elements to be enclosed in brackets. So add them. Fixes #33549 Signed-off-by: Daniel Leung --- include/kernel.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/kernel.h b/include/kernel.h index 03f3c586020e5f..4bba7d5c4f5d06 100644 --- a/include/kernel.h +++ b/include/kernel.h @@ -5228,7 +5228,9 @@ struct k_poll_event { .state = K_POLL_STATE_NOT_READY, \ .mode = _event_mode, \ .unused = 0, \ - .obj = _event_obj, \ + { \ + .obj = _event_obj, \ + }, \ } #define K_POLL_EVENT_STATIC_INITIALIZER(_event_type, _event_mode, _event_obj, \ @@ -5239,7 +5241,9 @@ struct k_poll_event { .state = K_POLL_STATE_NOT_READY, \ .mode = _event_mode, \ .unused = 0, \ - .obj = _event_obj, \ + { \ + .obj = _event_obj, \ + }, \ } /**