From 11f324ee661d7a7ba1933f74430fe1ae14648e40 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Wed, 5 Oct 2016 22:13:13 +0300 Subject: Workaround '#error' cppcheck error messages * src/atomic_ops.h [AO_REQUIRE_CAS && !AO_CAN_EMUL_CAS]: Skip #error pragma if CPPCHECK. * src/atomic_ops/generalize.h [AO_HAVE_nop_acquire]: Likewise. * src/atomic_ops/generalize.h [AO_HAVE_nop_release]: Likewise. * src/atomic_ops/sysdeps/armcc/arm_v6.h [__TARGET_ARCH_ARM < 6]: Likewise. --- src/atomic_ops/generalize.h | 5 +++-- src/atomic_ops/sysdeps/armcc/arm_v6.h | 4 +++- src/atomic_ops/sysdeps/msftc/x86.h | 4 ++-- 3 files changed, 8 insertions(+), 5 deletions(-) (limited to 'src/atomic_ops') diff --git a/src/atomic_ops/generalize.h b/src/atomic_ops/generalize.h index 6b17163..489f246 100644 --- a/src/atomic_ops/generalize.h +++ b/src/atomic_ops/generalize.h @@ -187,10 +187,11 @@ # define AO_HAVE_nop_full #endif -#if defined(AO_HAVE_nop_acquire) +#if defined(AO_HAVE_nop_acquire) && !defined(CPPCHECK) # error AO_nop_acquire is useless: do not define. #endif -#if defined(AO_HAVE_nop_release) + +#if defined(AO_HAVE_nop_release) && !defined(CPPCHECK) # error AO_nop_release is useless: do not define. #endif diff --git a/src/atomic_ops/sysdeps/armcc/arm_v6.h b/src/atomic_ops/sysdeps/armcc/arm_v6.h index c205deb..03aa1d6 100644 --- a/src/atomic_ops/sysdeps/armcc/arm_v6.h +++ b/src/atomic_ops/sysdeps/armcc/arm_v6.h @@ -23,7 +23,9 @@ #include "../test_and_set_t_is_ao_t.h" /* Probably suboptimal */ #if __TARGET_ARCH_ARM < 6 -# error Do not use with ARM instruction sets lower than v6 +# if !defined(CPPCHECK) +# error Do not use with ARM instruction sets lower than v6 +# endif #else #define AO_ACCESS_CHECK_ALIGNED diff --git a/src/atomic_ops/sysdeps/msftc/x86.h b/src/atomic_ops/sysdeps/msftc/x86.h index 7c2995a..0e26aaa 100644 --- a/src/atomic_ops/sysdeps/msftc/x86.h +++ b/src/atomic_ops/sysdeps/msftc/x86.h @@ -103,8 +103,8 @@ AO_test_and_set_full(volatile AO_TS_t *addr) } #define AO_HAVE_test_and_set_full -#ifdef _WIN64 -# error wrong architecture +#if defined(_WIN64) && !defined(CPPCHECK) +# error wrong architecture #endif #ifdef AO_ASSUME_VISTA -- cgit v1.2.1