From 00f03f600f29323cc6fd1c0f484a06d31acfd51d Mon Sep 17 00:00:00 2001 From: Dragos Motrea Date: Thu, 13 Jul 2017 13:55:42 +0200 Subject: [rt-tools][LXCR-7892][PATCHv1 1/1] bitcalc: resolved compilation warnings Two warnings resolved: functions which are candidates for 'pure' attribute and an uninitialized variable. Upstream-Status: Submitted Signed-off-by: Dragos Motrea --- bitcalc/src/bitcalc.c | 2 +- bitcalc/src/bitmap.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bitcalc/src/bitcalc.c b/bitcalc/src/bitcalc.c index bae4c06..8a51628 100644 --- a/bitcalc/src/bitcalc.c +++ b/bitcalc/src/bitcalc.c @@ -54,7 +54,7 @@ static size_t bitmap_stack_depth_max = 0; static char *bitmap_str(const struct bitmap_t *set) { - char *str; + char *str = NULL; switch (display_format) { case format_mask: diff --git a/bitcalc/src/bitmap.h b/bitcalc/src/bitmap.h index 17fee3a..5022dac 100644 --- a/bitcalc/src/bitmap.h +++ b/bitcalc/src/bitmap.h @@ -61,10 +61,10 @@ extern struct bitmap_t *bitmap_alloc_from_u32_list(const char *mlist); */ /* Return 1 if bit is set in bit mask, 0 otherwise. */ -extern int bitmap_isset(size_t bit, const struct bitmap_t *set); +extern int bitmap_isset(size_t bit, const struct bitmap_t *set) __attribute__((pure)); /* Return the number of bits set in bit mask. */ -extern size_t bitmap_bit_count(const struct bitmap_t *set); +extern size_t bitmap_bit_count(const struct bitmap_t *set) __attribute__((pure)); /* * Modify bitmap -- 2.7.4