From 11e904f02cb1ec4e17e71b9925f35d5f7786e5fe Mon Sep 17 00:00:00 2001 From: Ruediger Meier Date: Mon, 12 Jun 2017 01:59:36 +0200 Subject: [PATCH] libblkid: fix gcc-7 warning -Wint-in-bool-context BLOCK_SIZE(sb) should be unsigned so that the left shift is defined. This was the warning: ../libblkid/src/superblocks/exfat.c: In function 'probe_exfat': ../libblkid/src/superblocks/exfat.c:40:42: warning: '<<' in boolean context, did you mean '<' ? [-Wint-in-bool-context] #define CLUSTER_SIZE(sb) (BLOCK_SIZE(sb) << (sb)->bpc_bits) ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ ../libblkid/src/superblocks/exfat.c:122:14: note: in expansion of macro 'CLUSTER_SIZE' if (!sb || !CLUSTER_SIZE(sb)) ^~~~~~~~~~~~ Signed-off-by: Ruediger Meier --- libblkid/src/superblocks/exfat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libblkid/src/superblocks/exfat.c b/libblkid/src/superblocks/exfat.c index 659e196c2d..4bf92eac80 100644 --- a/libblkid/src/superblocks/exfat.c +++ b/libblkid/src/superblocks/exfat.c @@ -36,7 +36,7 @@ struct exfat_entry_label { uint8_t name[30]; } __attribute__((__packed__)); -#define BLOCK_SIZE(sb) (1 << (sb)->block_bits) +#define BLOCK_SIZE(sb) (1u << (sb)->block_bits) #define CLUSTER_SIZE(sb) (BLOCK_SIZE(sb) << (sb)->bpc_bits) #define EXFAT_FIRST_DATA_CLUSTER 2 #define EXFAT_LAST_DATA_CLUSTER 0xffffff6 -- 2.47.2