From: Ivan Maidanski Date: Tue, 18 Oct 2016 10:05:02 +0000 (+0300) Subject: Workaround 'redundant assignment of *result to itself' cppcheck warning X-Git-Tag: v7.4.6~189 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b6fc555238ad5046f004813859f70dc85d41b0cf;p=gc 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. --- diff --git a/os_dep.c b/os_dep.c index 65615cae..5f70e452 100644 --- a/os_dep.c +++ b/os_dep.c @@ -1847,7 +1847,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();