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: v7.6.2~246 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cec8655c9675c5e50aa3e3c139137e991cdd54da;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 0af4131d..e6d641bf 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;