From: Ivan Maidanski Date: Tue, 25 Oct 2016 22:07:33 +0000 (+0300) Subject: Revert "Workaround 'suspicious ptr subtraction' cppcheck warning in gc_cpp" X-Git-Tag: v8.0.0~1072 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7e81c1dc0b62e11a38b92395595b30fe762ca60c;p=gc Revert "Workaround 'suspicious ptr subtraction' cppcheck warning in gc_cpp" This reverts commit 363890b2ab8365dcc6b87a2a6c4752c1f710dcf2. Because the warning is still reported by the recent versions of cppcheck (as of Oct 2016). --- diff --git a/include/gc_cpp.h b/include/gc_cpp.h index 8c9d0549..b0ab2609 100644 --- a/include/gc_cpp.h +++ b/include/gc_cpp.h @@ -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);