From df92cb6b8e0f15770878193fb1a28b8a4e364281 Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Thu, 5 Aug 2021 16:27:51 -0300 Subject: [PATCH] core: Change last_seen_bit to uint32_t in class__find_holes() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit And it is being compared against uint32_t variables, resulting in this clang warning: /var/home/acme/git/pahole/dwarves.c: In function ‘class__find_holes’: /var/home/acme/git/pahole/dwarves.c:1439:43: warning: comparison of integer expressions of different signedness: ‘int’ and ‘uint32_t’ {aka ‘unsigned int’} [-Wsign-compare] 1439 | if (last_seen_bit < aligned_start && aligned_start <= bit_start) { | ^ Since it can't be less than zero, just make then uint32_t. Signed-off-by: Arnaldo Carvalho de Melo --- dwarves.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dwarves.c b/dwarves.c index e8c3d80..70ca79c 100644 --- a/dwarves.c +++ b/dwarves.c @@ -1391,8 +1391,7 @@ void class__find_holes(struct class *class) struct class_member *pos, *last = NULL; uint32_t cur_bitfield_end = ctype->size * 8, cur_bitfield_size = 0; int bit_holes = 0, byte_holes = 0; - uint32_t bit_start, bit_end; - int last_seen_bit = 0; + uint32_t bit_start, bit_end, last_seen_bit = 0; bool in_bitfield = false; if (!tag__is_struct(class__tag(class)))