From 387a566a204af010496260113e2311bb04a6a529 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Tue, 29 May 2018 20:51:48 +0300 Subject: [PATCH] Eliminate 'comparing signed and unsigned values' compiler warnings (bcc) * allchblk.c (GC_allochblk_nth): Cast HBLKSIZE to signed_word in comparison to size_needed. * reclaim.c (GC_reclaim_all): Cast hhdr->hb_last_reclaimed to word in comparison to GC_gc_no-1. --- allchblk.c | 3 ++- reclaim.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/allchblk.c b/allchblk.c index 010fb8a..a4dbc05 100644 --- a/allchblk.c +++ b/allchblk.c @@ -754,7 +754,8 @@ GC_allochblk_nth(size_t sz, int kind, unsigned flags, int n, int may_split) GC_large_alloc_warn_suppressed = 0; } size_avail = orig_avail; - } else if (size_avail == 0 && size_needed == HBLKSIZE + } else if (size_avail == 0 + && size_needed == (signed_word)HBLKSIZE && IS_MAPPED(hhdr)) { if (!GC_find_leak) { static unsigned count = 0; diff --git a/reclaim.c b/reclaim.c index 85591a3..3c3583e 100644 --- a/reclaim.c +++ b/reclaim.c @@ -738,7 +738,8 @@ GC_INNER GC_bool GC_reclaim_all(GC_stop_func stop_func, GC_bool ignore_old) } hhdr = HDR(hbp); *rlh = hhdr -> hb_next; - if (!ignore_old || hhdr -> hb_last_reclaimed == GC_gc_no - 1) { + if (!ignore_old + || (word)hhdr->hb_last_reclaimed == GC_gc_no - 1) { /* It's likely we'll need it this time, too */ /* It's been touched recently, so this */ /* shouldn't trigger paging. */ -- 2.7.4