From: Ivan Maidanski Date: Tue, 14 Feb 2017 08:24:18 +0000 (+0300) Subject: Workaround '!GC_page_size is always false' cppcheck style warning X-Git-Tag: v8.0.0~921 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7c3d17ee43b21259a35267906bbcdda995dff3dd;p=gc Workaround '!GC_page_size is always false' cppcheck style warning * os_dep.c [!MSWIN32] (GC_setpagesize): Do not check that GC_page_size is non-zero if CPPCHECK. --- diff --git a/os_dep.c b/os_dep.c index 0fb5ccc0..ddb577de 100644 --- a/os_dep.c +++ b/os_dep.c @@ -805,7 +805,10 @@ GC_INNER size_t GC_page_size = 0; { # if defined(MPROTECT_VDB) || defined(PROC_VDB) || defined(USE_MMAP) GC_page_size = (size_t)GETPAGESIZE(); - if (!GC_page_size) ABORT("getpagesize failed"); +# if !defined(CPPCHECK) + if (0 == GC_page_size) + ABORT("getpagesize failed"); +# endif # else /* It's acceptable to fake it. */ GC_page_size = HBLKSIZE;