diff --git a/src/elements/core.c b/src/elements/core.c index 78418c40..c3e2ca24 100644 --- a/src/elements/core.c +++ b/src/elements/core.c @@ -751,7 +751,9 @@ static __always_inline bool atomic_cas64(volatile uint64_t *p, uint64_t c, uint64_t v) { #if defined(ATOMIC_VAR_INIT) || defined(ATOMIC_LLONG_LOCK_FREE) STATIC_ASSERT(sizeof(long long) >= sizeof(uint64_t)); +#ifndef __COVERITY__ STATIC_ASSERT(atomic_is_lock_free(p)); +#endif /* Workaround for Coverity */ return atomic_compare_exchange_strong((_Atomic uint64_t *)p, &c, v); #elif defined(__GNUC__) || defined(__clang__) return __sync_bool_compare_and_swap(p, c, v); @@ -770,7 +772,9 @@ static __always_inline bool atomic_cas32(volatile uint32_t *p, uint32_t c, uint32_t v) { #if defined(ATOMIC_VAR_INIT) || defined(ATOMIC_INT_LOCK_FREE) STATIC_ASSERT(sizeof(int) >= sizeof(uint32_t)); +#ifndef __COVERITY__ STATIC_ASSERT(atomic_is_lock_free(p)); +#endif /* Workaround for Coverity */ return atomic_compare_exchange_strong((_Atomic uint32_t *)p, &c, v); #elif defined(__GNUC__) || defined(__clang__) return __sync_bool_compare_and_swap(p, c, v); @@ -787,7 +791,9 @@ static __always_inline bool atomic_cas32(volatile uint32_t *p, uint32_t c, static __always_inline uint32_t atomic_add32(volatile uint32_t *p, uint32_t v) { #if defined(ATOMIC_VAR_INIT) || defined(ATOMIC_INT_LOCK_FREE) STATIC_ASSERT(sizeof(int) >= sizeof(uint32_t)); +#ifndef __COVERITY__ STATIC_ASSERT(atomic_is_lock_free(p)); +#endif /* Workaround for Coverity */ return atomic_fetch_add((_Atomic uint32_t *)p, v); #elif defined(__GNUC__) || defined(__clang__) return __sync_fetch_and_add(p, v); diff --git a/src/elements/defs.h b/src/elements/defs.h index 9e262e2f..5156df84 100644 --- a/src/elements/defs.h +++ b/src/elements/defs.h @@ -309,17 +309,6 @@ # endif #endif /* unlikely */ -/* Workaround for Coverity Scan */ -#if defined(__COVERITY__) && __GNUC_PREREQ(7, 0) && !defined(__cplusplus) -typedef float _Float32; -typedef double _Float32x; -typedef double _Float64; -typedef long double _Float64x; -typedef float _Float128 __attribute__((__mode__(__TF__))); -typedef __complex__ float __cfloat128 __attribute__ ((__mode__ (__TC__))); -typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__TC__))); -#endif /* Workaround for Coverity Scan */ - #ifndef __printf_args # if defined(__GNUC__) || __has_attribute(__format__) # define __printf_args(format_index, first_arg) \