Workaround 'value of AO_compiler_barrier unknown' cppcheck info message
authorIvan Maidanski <ivmai@mail.ru>
Sat, 17 Dec 2016 15:43:00 +0000 (18:43 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Sat, 17 Dec 2016 15:43:00 +0000 (18:43 +0300)
(fix commit e3ec4a5)

* mark.c (GC_noop6): Call AO_compiler_barrier() only if PARALLEL_MARK
or GC_PTHREADS and not GC_WIN32_THREADS (do not use
"#ifdef AO_compiler_barrier").

mark.c

diff --git a/mark.c b/mark.c
index dec761b..36b39e5 100644 (file)
--- a/mark.c
+++ b/mark.c
@@ -30,7 +30,8 @@ void GC_noop6(word arg1 GC_ATTR_UNUSED, word arg2 GC_ATTR_UNUSED,
               word arg5 GC_ATTR_UNUSED, word arg6 GC_ATTR_UNUSED)
 {
   /* Avoid GC_noop6 calls to be optimized away. */
-# ifdef AO_compiler_barrier
+# if defined(GC_PTHREADS) && !defined(GC_WIN32_THREADS) \
+     || defined(PARALLEL_MARK)
     AO_compiler_barrier(); /* to serve as a special side-effect */
 # else
     GC_noop1(0);