From f604d3dec85f4b2a7061d068bed6854e2ac2db27 Mon Sep 17 00:00:00 2001 From: Gunar Schorcht Date: Mon, 29 Jul 2019 13:10:08 +0200 Subject: [PATCH 1/2] sys/event: fix of compilation problems Unstructured static initializer like { 0 } lead to compilation errors on ESP8266, MSP430 and MIPS. Error messages are: error: (near initialization for 'queue.event_list') [-Werror=missing-braces] error: (near initialization for 'queue.waiter') [-Werror=missing-field-initializers] This change fixes the compilation problem. --- sys/include/event.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/include/event.h b/sys/include/event.h index dcea3c23a9..b5f1981dfd 100644 --- a/sys/include/event.h +++ b/sys/include/event.h @@ -121,7 +121,7 @@ extern "C" { /** * @brief static initializer for detached event queues */ -#define EVENT_QUEUE_INIT_DETACHED { 0 } +#define EVENT_QUEUE_INIT_DETACHED { .waiter = NULL } /** * @brief event structure forward declaration From dcfd83c1ba8b76faa7aef3b4277d80902a195032 Mon Sep 17 00:00:00 2001 From: Gunar Schorcht Date: Mon, 29 Jul 2019 16:40:41 +0200 Subject: [PATCH 2/2] tests/event: use EVENT_QUEUE_INIT_DETACHED Changes the test so that EVENT_QUEUE_INIT_DETACHED is used for the initialization of detached event queue. Without this change, a compilation problem was not recognized for ESP8266, MSP430 and MIPS. --- tests/events/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/events/main.c b/tests/events/main.c index bc2672a1af..a29c368cd4 100644 --- a/tests/events/main.c +++ b/tests/events/main.c @@ -128,7 +128,7 @@ int main(void) puts("[START] event test application.\n"); /* test creation of delayed claiming of a detached event queue */ - event_queue_t dq; + event_queue_t dq = EVENT_QUEUE_INIT_DETACHED; printf("initializing detached event queue %p\n", (void *)&dq); event_queue_init_detached(&dq);