From cc91e8234f69126482ebdafc78de64705b06c5fc Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Tue, 10 Sep 2019 23:28:15 +0300 Subject: [PATCH] Workaround 'cnt var assigned but not used' cppcheck FP in copy_ptr_regs (fix of commit 912ec408d) * win32_threads.c [!I386 && !X86_64 && !ARM32 && !AARCH64 && !SHx && !MIPS && !PPC && !ALPHA && CPPCHECK] (copy_ptr_regs): Set sp to cnt value (with a cast); add comment. --- win32_threads.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/win32_threads.c b/win32_threads.c index 5a35e70..f6049b3 100644 --- a/win32_threads.c +++ b/win32_threads.c @@ -1566,7 +1566,9 @@ static ptr_t copy_ptr_regs(word *regs, const CONTEXT *pcontext) { PUSH4(IntA0,IntA1,IntA2,IntA3), PUSH4(IntA4,IntA5,IntT8,IntT9); PUSH4(IntT10,IntT11,IntT12,IntAt); sp = (ptr_t)context.IntSp; -# elif !defined(CPPCHECK) +# elif defined(CPPCHECK) + sp = (ptr_t)(word)cnt; /* to workaround "cnt not used" false positive */ +# else # error Architecture is not supported # endif # undef context -- 2.7.4