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/mutex/mutex_adaptive.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'kern/mutex/mutex_adaptive.c') diff --git a/kern/mutex/mutex_adaptive.c b/kern/mutex/mutex_adaptive.c index bda54532..db92f9d5 100644 --- a/kern/mutex/mutex_adaptive.c +++ b/kern/mutex/mutex_adaptive.c @@ -333,9 +333,14 @@ mutex_adaptive_setup(void) return 0; } -INIT_OP_DEFINE(mutex_adaptive_setup, - INIT_OP_DEP(mutex_adaptive_bootstrap, true), #ifdef CONFIG_MUTEX_DEBUG +#define MUTEX_ADAPTIVE_DEBUG_INIT_OP_DEPS \ INIT_OP_DEP(syscnt_setup, true), +#else /* CONFIG_MUTEX_DEBUG */ +#define MUTEX_ADAPTIVE_DEBUG_INIT_OP_DEPS #endif /* CONFIG_MUTEX_DEBUG */ + +INIT_OP_DEFINE(mutex_adaptive_setup, + INIT_OP_DEP(mutex_adaptive_bootstrap, true), + MUTEX_ADAPTIVE_DEBUG_INIT_OP_DEPS ); -- cgit v1.2.3