From 087fb9430da22def772b829e1d6a4fb35f6d3b79 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 332dec03409..08db8565218 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, \ + }, \ } /**