]> granicus.if.org Git - gc/commitdiff
Workaround more '#error' cppcheck error messages
authorIvan Maidanski <ivmai@mail.ru>
Thu, 13 Oct 2016 08:03:04 +0000 (11:03 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 1 Nov 2016 22:49:08 +0000 (01:49 +0300)
* darwin_stop_world.c (GC_stack_range_for): Skip #error pragma if
CPPCHECK.
* dyn_load.c [DYNAMIC_LOADING && !PCR && !DARWIN]: Likewise.
* dyn_load.c [SOLARISDL && !PCR && !GC_SOLARIS_THREADS && THREADS]:
Likewise.
* include/private/gc_priv.h [!POWERPC && !I386 && !X86_64 && !ARM32
&& !AARCH64] (GC_THREAD_STATE_T): Likewise.
* include/private/gcconfig.h [GC_IRIX_THREADS && !IRIX5 || ...]:
Likewise.
* include/private/gcconfig.h [PARALLEL_MARK && !THREADS]: Likewise.
* include/private/gcconfig.h [MARK_BIT_PER_GRANULE && MARK_BIT_PER_OBJ
|| ...]: Likewise.
* pcr_interface.c [PCR] (GC_enumerate_block): Likewise.
* win32_threads.c [!I386 && !X86_64 && !ARM32 && !SHx && !MIPS && !PPC
&& !ALPHA] (GC_push_stack_for): Likewise.
* darwin_stop_world.c (GC_stack_range_for): Initialize "lo" local
variable even if platform unsupported.

darwin_stop_world.c
dyn_load.c
include/private/gc_priv.h
include/private/gcconfig.h
pcr_interface.c
win32_threads.c

index 418538ea113b8bf0d4dc094af4240835947333e7..2e011d8da43a94525ab836aa69e6f76c8e46ff68 100644 (file)
@@ -304,6 +304,8 @@ STATIC ptr_t GC_stack_range_for(ptr_t *phi, thread_act_t thread, GC_thread p,
       GC_push_one(state.THREAD_FLD(fp));
       GC_push_one(state.THREAD_FLD(lr));
 
+#   elif defined(CPPCHECK)
+      lo = NULL;
 #   else
 #     error FIXME for non-x86 || ppc || arm architectures
 #   endif
index fe69128dd366602bbb6265567ef158223eaa2f93..a03aa6e9a78758f2dd386acb69009e7451a57655 100644 (file)
@@ -59,7 +59,8 @@ STATIC GC_has_static_roots_func GC_has_static_roots = 0;
     && !(defined(FREEBSD) && defined(__ELF__)) \
     && !((defined(LINUX) || defined(NACL)) && defined(__ELF__)) \
     && !(defined(NETBSD) && defined(__ELF__)) && !defined(HURD) \
-    && !(defined(OPENBSD) && (defined(__ELF__) || defined(M68K)))
+    && !(defined(OPENBSD) && (defined(__ELF__) || defined(M68K))) \
+    && !defined(CPPCHECK)
 # error We only know how to find data segments of dynamic libraries for above.
 # error Additional SVR4 variants might not be too hard to add.
 #endif
@@ -212,7 +213,8 @@ GC_FirstDLOpenedLinkMap(void)
 # if defined(SOLARISDL)
 
 /* Add dynamic library data sections to the root set.           */
-# if !defined(PCR) && !defined(GC_SOLARIS_THREADS) && defined(THREADS)
+# if !defined(PCR) && !defined(GC_SOLARIS_THREADS) && defined(THREADS) \
+     && !defined(CPPCHECK)
 #   error Fix mutual exclusion with dlopen
 # endif
 
index 8d77171fcee361a30be0e49093a4202cbe293ba5..73eb48cdc67a74e36e4d2ea0b0ea2053347e4ddd 100644 (file)
@@ -629,7 +629,7 @@ GC_EXTERN GC_warn_proc GC_current_warn_proc;
 #   define GC_THREAD_STATE_T            arm_thread_state64_t
 #   define GC_MACH_THREAD_STATE         ARM_THREAD_STATE64
 #   define GC_MACH_THREAD_STATE_COUNT   ARM_THREAD_STATE64_COUNT
-# else
+# elif !defined(CPPCHECK)
 #   error define GC_THREAD_STATE_T
 # endif
 # ifndef GC_MACH_THREAD_STATE
index 759e3b81c8dc8164ed69b3c4326eebb22722366d..d45abda8b48576c7f966aca55b5322e06ad9ebfa 100644 (file)
 # define INCLUDE_LINUX_THREAD_DESCR
 #endif
 
+#if !defined(CPPCHECK)
 #if defined(GC_IRIX_THREADS) && !defined(IRIX5)
 # error --> inconsistent configuration
 #endif
     && !defined(MSWINCE)
 # error --> inconsistent configuration
 #endif
+#endif /* !CPPCHECK */
 
 #if defined(PCR) || defined(GC_WIN32_THREADS) || defined(GC_PTHREADS) \
     || defined(SN_TARGET_PS3)
 # define THREADS
 #endif
 
-#if defined(PARALLEL_MARK) && !defined(THREADS)
+#if defined(PARALLEL_MARK) && !defined(THREADS) && !defined(CPPCHECK)
 # error "invalid config - PARALLEL_MARK requires GC_THREADS"
 #endif
 
 #endif
 
 /* Some static sanity tests.    */
+#if !defined(CPPCHECK)
 #if defined(MARK_BIT_PER_GRANULE) && defined(MARK_BIT_PER_OBJ)
 # error Define only one of MARK_BIT_PER_GRANULE and MARK_BIT_PER_OBJ.
 #endif
      && !defined(REDIRECT_MALLOC_IN_HEADER)
 # error "REDIRECT_MALLOC with THREADS works at most on Linux."
 #endif
+#endif /* !CPPCHECK */
 
 #ifdef GC_PRIVATE_H
         /* This relies on some type definitions from gc_priv.h, from    */
index c6c868c3b946c3e03693e8f0971752597fb2ef73..35213bf1baafcecaadaa67918ba2288ddb4cebda 100644 (file)
@@ -72,9 +72,11 @@ void GC_enumerate_block(struct hblk *h; enumerate_data * ed)
     ptr_t p;
     ptr_t lim;
     word descr;
+
+# if !defined(CPPCHECK)
 #   error This code was updated without testing.
 #   error and its precursor was clearly broken.
-
+# endif
     hhdr = HDR(h);
     descr = hhdr -> hb_descr;
     sz = hhdr -> hb_sz;
index 7c86ac572244c87a844bb30cd6278d89df7472e8..e778fb03a166c8299271ff5f5c38e9c8692384ad 100644 (file)
@@ -1431,7 +1431,7 @@ STATIC word GC_push_stack_for(GC_thread thread, DWORD me)
       PUSH4(IntA0,IntA1,IntA2,IntA3), PUSH4(IntA4,IntA5,IntT8,IntT9);
       PUSH4(IntT10,IntT11,IntT12,IntAt);
       sp = (ptr_t)context.IntSp;
-#   else
+#   elif !defined(CPPCHECK)
 #     error "architecture is not supported"
 #   endif
   } /* ! current thread */