From 24c96c805c4acaf8897d3ea13a7d9346b254267c Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Thu, 28 Dec 2017 21:09:25 +0300 Subject: [PATCH] Eliminate 'function is never used' cppcheck warning for load_before_cas (fix commit 441415c8) * src/atomic_ops_stack.c [!AO_USE_ALMOST_LOCK_FREE && AO_THREAD_SANITIZER && !AO_HAVE_compare_and_swap_double && !AO_HAVE_compare_double_and_swap_double] (load_before_cas): Define as macro (not as a static function). --- src/atomic_ops_stack.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/atomic_ops_stack.c b/src/atomic_ops_stack.c index 11d385e..6008b89 100644 --- a/src/atomic_ops_stack.c +++ b/src/atomic_ops_stack.c @@ -225,7 +225,9 @@ AO_stack_pop_explicit_aux_acquire(volatile AO_t *list, AO_stack_aux * a) /* The functionality is the same as of AO_load_next but the atomicity */ /* is not needed. The usage is similar to that of store_before_cas. */ -#ifdef AO_THREAD_SANITIZER +#if defined(AO_THREAD_SANITIZER) \ + && (defined(AO_HAVE_compare_and_swap_double) \ + || defined(AO_HAVE_compare_double_and_swap_double)) /* TODO: If compiled by Clang (as of clang-4.0) with -O3 flag, */ /* no_sanitize attribute is ignored unless the argument is volatile. */ # if defined(__clang__) -- 2.40.0