From: Ruediger Meier Date: Sun, 11 Jun 2017 23:59:36 +0000 (+0200) Subject: libblkid: fix gcc-7 warning -Wint-in-bool-context X-Git-Tag: v2.31-rc1~310 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=11e904f02cb1ec4e17e71b9925f35d5f7786e5fe;p=thirdparty%2Futil-linux.git 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 --- 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