Revert "Workaround 'suspicious ptr subtraction' cppcheck warning in gc_cpp"
authorIvan Maidanski <ivmai@mail.ru>
Tue, 25 Oct 2016 22:07:33 +0000 (01:07 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 25 Oct 2016 22:07:33 +0000 (01:07 +0300)
This reverts commit 363890b2ab8365dcc6b87a2a6c4752c1f710dcf2.

Because the warning is still reported by the recent versions of
cppcheck (as of Oct 2016).

include/gc_cpp.h

index 8c9d054..b0ab260 100644 (file)
@@ -432,7 +432,7 @@ inline gc_cleanup::gc_cleanup()
   if (base != 0) {
     // Don't call the debug version, since this is a real base address.
     GC_register_finalizer_ignore_self(base, (GC_finalization_proc) cleanup,
-                                      (void*) (((char*) this) - (char*) base),
+                                      (void*) ((char*) this - (char*) base),
                                       &oldProc, &oldData);
     if (oldProc != 0) {
       GC_register_finalizer_ignore_self(base, oldProc, oldData, 0, 0);