]> granicus.if.org Git - gc/commitdiff
Workaround 'redundant assignment of *result to itself' cppcheck warning
authorIvan Maidanski <ivmai@mail.ru>
Tue, 18 Oct 2016 10:05:02 +0000 (13:05 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Mon, 6 Feb 2017 18:36:26 +0000 (21:36 +0300)
* os_dep.c [DGUX || LINUX && SPARC] (GC_SysVGetDataStart): Call
GC_noop1(&v) if CPPCHECK where v = *result.

os_dep.c

index 65615caed34d75001199faafd1d3201a42f735f5..5f70e4522de5ef493335073b58d08601725a29a3 100644 (file)
--- 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();