summaryrefslogtreecommitdiff
path: root/src/atomic_ops
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2016-10-05 22:13:13 +0300
committerIvan Maidanski <ivmai@mail.ru>2016-10-05 22:13:13 +0300
commit11f324ee661d7a7ba1933f74430fe1ae14648e40 (patch)
tree1fd282a1a6f728703391170d04f1681e93f27509 /src/atomic_ops
parent2f18c21601472fac497d9d6bd3f5881ad75254ce (diff)
downloadlibatomic_ops-11f324ee661d7a7ba1933f74430fe1ae14648e40.tar.gz
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.
Diffstat (limited to 'src/atomic_ops')
-rw-r--r--src/atomic_ops/generalize.h5
-rw-r--r--src/atomic_ops/sysdeps/armcc/arm_v6.h4
-rw-r--r--src/atomic_ops/sysdeps/msftc/x86.h4
3 files changed, 8 insertions, 5 deletions
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