summaryrefslogtreecommitdiff
path: root/os_dep.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2018-12-19 22:50:57 +0300
committerIvan Maidanski <ivmai@mail.ru>2018-12-19 22:50:57 +0300
commit0031a614c3154d574dd55b4e32c141130a65afb1 (patch)
tree85e0a37a322af80dda8e628c543a61c7c64b3709 /os_dep.c
parenta25965b5f0ce893d07274256ff2391d480924b59 (diff)
downloadbdwgc-0031a614c3154d574dd55b4e32c141130a65afb1.tar.gz
Eliminate 'stop variable is always 0' compiler warning in print_callers
* os_dep.c [NEED_CALLINFO] (GC_print_callers): Declare (and use value of) stop local variable only if LINUX && !SMALL_CONFIG; move stop local variable to the scope of its use.
Diffstat (limited to 'os_dep.c')
-rw-r--r--os_dep.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/os_dep.c b/os_dep.c
index 8477f3a7..f71469c4 100644
--- a/os_dep.c
+++ b/os_dep.c
@@ -4654,7 +4654,6 @@ GC_INNER void GC_print_callers(struct callinfo info[NFRAMES])
{
int i;
static int reentry_count = 0;
- GC_bool stop = FALSE;
DCL_LOCK_STATE;
/* FIXME: This should probably use a different lock, so that we */
@@ -4668,8 +4667,13 @@ GC_INNER void GC_print_callers(struct callinfo info[NFRAMES])
# else
GC_err_printf("\tCall chain at allocation:\n");
# endif
- for (i = 0; i < NFRAMES && !stop; i++) {
- if (info[i].ci_pc == 0) break;
+ for (i = 0; i < NFRAMES; i++) {
+# if defined(LINUX) && !defined(SMALL_CONFIG)
+ GC_bool stop = FALSE;
+# endif
+
+ if (0 == info[i].ci_pc)
+ break;
# if NARGS > 0
{
int j;
@@ -4811,6 +4815,10 @@ GC_INNER void GC_print_callers(struct callinfo info[NFRAMES])
free(sym_name); /* May call GC_[debug_]free; that's OK */
# endif
}
+# if defined(LINUX) && !defined(SMALL_CONFIG)
+ if (stop)
+ break;
+# endif
}
LOCK();
--reentry_count;