diff options
author | Richard Braun <rbraun@sceen.net> | 2018-01-29 00:52:40 +0100 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2018-01-29 01:12:05 +0100 |
commit | bc6e853d4b27055056eebfd871aaf0fc60405b0f (patch) | |
tree | 9860d545d88a627fcea3309efea89cb27779aaf9 /kern/mutex | |
parent | 3ec2193d8538beec5d961d11d67f568d8d3f6cd8 (diff) |
Fix undefined behavior in conditional macro replacement
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.
Diffstat (limited to 'kern/mutex')
-rw-r--r-- | kern/mutex/mutex_adaptive.c | 9 | ||||
-rw-r--r-- | kern/mutex/mutex_plain.c | 10 |
2 files changed, 15 insertions, 4 deletions
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 ); diff --git a/kern/mutex/mutex_plain.c b/kern/mutex/mutex_plain.c index 266bd70b..f12f13fd 100644 --- a/kern/mutex/mutex_plain.c +++ b/kern/mutex/mutex_plain.c @@ -173,9 +173,15 @@ mutex_plain_setup(void) return 0; } -INIT_OP_DEFINE(mutex_plain_setup, - INIT_OP_DEP(mutex_plain_bootstrap, true), #ifdef CONFIG_MUTEX_DEBUG +#define MUTEX_PLAIN_DEBUG_INIT_OP_DEPS \ INIT_OP_DEP(syscnt_setup, true), +#else /* CONFIG_MUTEX_DEBUG */ +#define MUTEX_PLAIN_DEBUG_INIT_OP_DEPS #endif /* CONFIG_MUTEX_DEBUG */ + + +INIT_OP_DEFINE(mutex_plain_setup, + INIT_OP_DEP(mutex_plain_bootstrap, true), + MUTEX_PLAIN_DEBUG_INIT_OP_DEPS ); |