From 5900f43f1084497191624c84c69c016a804375df 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 bit_start and bit_end to uint32_t in class__find_holes() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit And they were 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:1453:73: warning: comparison of integer expressions of different signedness: ‘uint32_t’ {aka ‘unsigned int’} and ‘int’ [-Wsign-compare] 1453 | if (bit_end > cur_bitfield_end || pos->bit_size > cur_bitfield_size) { | Since they can't be less than zero, just make then uint32_t. Signed-off-by: Arnaldo Carvalho de Melo --- dwarves.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dwarves.c b/dwarves.c index a54a2c0..5b1da68 100644 --- a/dwarves.c +++ b/dwarves.c @@ -1391,7 +1391,7 @@ void class__find_holes(struct class *class) struct class_member *pos, *last = NULL; int cur_bitfield_end = ctype->size * 8, cur_bitfield_size = 0; int bit_holes = 0, byte_holes = 0; - int bit_start, bit_end; + uint32_t bit_start, bit_end; int last_seen_bit = 0; bool in_bitfield = false;