From b36c0d1c9710075d02f3dac32dd8b1b8e8979301 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Tue, 18 Oct 2016 13:05:02 +0300 Subject: [PATCH] Workaround 'redundant assignment of *result to itself' cppcheck warning * os_dep.c [DGUX || LINUX && SPARC] (GC_SysVGetDataStart): Call GC_noop1(&v) if CPPCHECK where v = *result. --- os_dep.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/os_dep.c b/os_dep.c index 6d12de1..1caf988 100644 --- a/os_dep.c +++ b/os_dep.c @@ -1852,7 +1852,11 @@ void GC_register_data_segments(void) GC_setup_temporary_fault_handler(); if (SETJMP(GC_jmp_buf) == 0) { /* Try writing to the address. */ - *result = *result; + char v = *result; +# if defined(CPPCHECK) + GC_noop1((word)&v); +# endif + *result = v; GC_reset_fault_handler(); } else { GC_reset_fault_handler(); -- 2.7.4