From bc6e853d4b27055056eebfd871aaf0fc60405b0f Mon Sep 17 00:00:00 2001 From: Richard Braun Date: Mon, 29 Jan 2018 00:52:40 +0100 Subject: Fix undefined behavior in conditional macro replacement MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See C11 6.10.3 ยง11 : If there are sequences of preprocessing tokens within the list of arguments that would otherwise act as preprocessing directives, the behavior is undefined. --- kern/rtmutex.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'kern/rtmutex.c') diff --git a/kern/rtmutex.c b/kern/rtmutex.c index 7457196d..55d17cdc 100644 --- a/kern/rtmutex.c +++ b/kern/rtmutex.c @@ -240,9 +240,14 @@ rtmutex_setup(void) return 0; } -INIT_OP_DEFINE(rtmutex_setup, - INIT_OP_DEP(rtmutex_bootstrap, true), #ifdef CONFIG_MUTEX_DEBUG +#define RTMUTEX_DEBUG_INIT_OPS \ INIT_OP_DEP(syscnt_setup, true), +#else /* CONFIG_MUTEX_DEBUG */ +#define RTMUTEX_DEBUG_INIT_OPS #endif /* CONFIG_MUTEX_DEBUG */ + +INIT_OP_DEFINE(rtmutex_setup, + INIT_OP_DEP(rtmutex_bootstrap, true), + RTMUTEX_DEBUG_INIT_OPS ); -- cgit v1.2.3