From 182cdcaed9055c766b27f51b4e788eb2ea3d151d 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 cur_bitfield_end 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:1430:44: note: in expansion of macro ‘min’ 1430 | int bitfield_end = min(bit_start, cur_bitfield_end); | ^~~ Since it 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 5b1da68..918d32d 100644 --- a/dwarves.c +++ b/dwarves.c @@ -1389,7 +1389,7 @@ void class__find_holes(struct class *class) { const struct type *ctype = &class->type; struct class_member *pos, *last = NULL; - int cur_bitfield_end = ctype->size * 8, cur_bitfield_size = 0; + 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;