Skip to content

Commit 6c48668

Browse files
committed
common-utils.c: fix clang warning
Fix: common-utils.c:1590:10: warning: implicit conversion from 'unsigned long' to 'double' changes value from 18446744073709551615 to 18446744073709551616 [-Wimplicit-const-int-float-conversion] 1590 | if ((UINT64_MAX - value) < 0) { | ^~~~~~~~~~ ~ /usr/include/stdint.h:119:23: note: expanded from macro 'UINT64_MAX' 119 | # define UINT64_MAX (__UINT64_C(18446744073709551615)) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/stdint.h:96:25: note: expanded from macro '__UINT64_C' 96 | # define __UINT64_C(c) c ## UL | ^~~~~~~ <scratch space>:38:1: note: expanded from here 38 | 18446744073709551615UL | ^~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Yaniv Kaul <[email protected]>
1 parent 18b1c83 commit 6c48668

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libglusterfs/src/common-utils.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1587,7 +1587,7 @@ gf_string2percent_or_bytesize(const char *str, double *n,
15871587
}
15881588

15891589
/* Error out if we cannot store the value in uint64 */
1590-
if ((UINT64_MAX - value) < 0) {
1590+
if ((UINT64_MAX - (unsigned long)value) < 0) {
15911591
errno = ERANGE;
15921592
return -1;
15931593
}

0 commit comments

Comments
 (0)