summaryrefslogtreecommitdiff
path: root/mach_dep.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2018-11-09 20:08:20 +0300
committerIvan Maidanski <ivmai@mail.ru>2018-11-09 20:10:51 +0300
commit4bd438c2524625fe098255d1a093b41d1c556a5c (patch)
treee5743f7f021daf64c5a3b9b71bc6f5c553ff598c /mach_dep.c
parentff278e28856968dbec3df4f015dc9b9a8bb0a080 (diff)
downloadbdwgc-4bd438c2524625fe098255d1a093b41d1c556a5c.tar.gz
Eliminate 'uninitialized var' cppcheck false positive in mach_dep, os_dep
* mach_dep.c (GC_with_callee_saves_pushed): Change type of "context" local variable from void* volatile to volatile ptr_t. * os_dep.c [(SVR4 || AIX || DGUX || (LINUX && SPARC)) && !PCR] (GC_SysVGetDataStart): Change type of "result" local variable from char* volatile to volatile ptr_t.
Diffstat (limited to 'mach_dep.c')
-rw-r--r--mach_dep.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/mach_dep.c b/mach_dep.c
index 8df57474..94605a30 100644
--- a/mach_dep.c
+++ b/mach_dep.c
@@ -228,7 +228,7 @@ GC_INNER void GC_with_callee_saves_pushed(void (*fn)(ptr_t, void *),
volatile ptr_t arg)
{
volatile int dummy;
- void * volatile context = 0;
+ volatile ptr_t context = 0;
# if defined(HAVE_PUSH_REGS)
GC_push_regs();
@@ -263,7 +263,7 @@ GC_INNER void GC_with_callee_saves_pushed(void (*fn)(ptr_t, void *),
/* getcontext() is broken, do not try again. */
/* E.g., to workaround a bug in Docker ubuntu_32bit. */
} else {
- context = &ctxt;
+ context = (ptr_t)&ctxt;
}
if (EXPECT(0 == getcontext_works, FALSE))
getcontext_works = context != NULL ? 1 : -1;
@@ -330,7 +330,7 @@ GC_INNER void GC_with_callee_saves_pushed(void (*fn)(ptr_t, void *),
# endif /* !HAVE_PUSH_REGS */
/* TODO: context here is sometimes just zero. At the moment, the */
/* callees don't really need it. */
- fn(arg, context);
+ fn(arg, (/* no volatile */ void *)context);
/* Strongly discourage the compiler from treating the above */
/* as a tail-call, since that would pop the register */
/* contents before we get a chance to look at them. */