summaryrefslogtreecommitdiff
path: root/mach_dep.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2016-10-18 11:39:17 +0300
committerIvan Maidanski <ivmai@mail.ru>2016-10-18 11:39:17 +0300
commit91a420c0c4dd26268791a80d73a475b1a87d4123 (patch)
tree6cdfa1fff2bba4a6de95676918e6d5090272c804 /mach_dep.c
parent0a1446ec893137544d676905291fd21c7fe6cf00 (diff)
downloadbdwgc-91a420c0c4dd26268791a80d73a475b1a87d4123.tar.gz
Workaround 'Uninitialized variable' cppcheck errors
* extra/AmigaOS.c [GC_AMIGA_DS] (GC_register_data_segments): Initialize myseglist outside conditional statement. * mach_dep.c [GETCONTEXT_FPU_EXCMASK_BUG && X86_64] (GC_with_callee_saves_pushed): Call GC_noop1(&old_fcw) (before asm fstcw) if CPPCHECK. * mach_dep.c [!HAVE_BUILTIN_UNWIND_INIT] (GC_with_callee_saves_pushed): Replace regs with &regs. * os_dep.c [!MSWIN32 && !GC_OPENBSD_THREADS && ...] (GC_get_main_stack_base): Set result to NULL if CPPCHECK but none of HEURISTIC* and *STACKBOTTOM defined.
Diffstat (limited to 'mach_dep.c')
-rw-r--r--mach_dep.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/mach_dep.c b/mach_dep.c
index 6a9bc0f0..61b5ed26 100644
--- a/mach_dep.c
+++ b/mach_dep.c
@@ -243,6 +243,9 @@ GC_INNER void GC_with_callee_saves_pushed(void (*fn)(ptr_t, void *),
/* client application to use -lm linker option. */
unsigned short old_fcw;
+# if defined(CPPCHECK)
+ GC_noop1((word)&old_fcw);
+# endif
__asm__ __volatile__ ("fstcw %0" : "=m" (*&old_fcw));
# else
int except_mask = fegetexcept();
@@ -292,8 +295,8 @@ GC_INNER void GC_with_callee_saves_pushed(void (*fn)(ptr_t, void *),
/* We're not sure whether he would like */
/* to be acknowledged for it or not. */
jmp_buf regs;
- register word * i = (word *) regs;
- register ptr_t lim = (ptr_t)(regs) + (sizeof regs);
+ register word * i = (word *) &regs;
+ register ptr_t lim = (ptr_t)(&regs) + (sizeof regs);
/* Setjmp doesn't always clear all of the buffer. */
/* That tends to preserve garbage. Clear it. */