From cec8655c9675c5e50aa3e3c139137e991cdd54da Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Tue, 14 Feb 2017 11:24:18 +0300 Subject: [PATCH] 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. --- os_dep.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; -- 2.40.0