[git commit] bc: Add 'U' suffix in UINT_MAX preprocessor check

Denys Vlasenko vda.linux at googlemail.com
Thu Sep 12 10:23:46 UTC 2019


commit: https://git.busybox.net/busybox/commit/?id=f159352112671e3c1e07356ebf6f590d8f79c8ff
branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master

Without the 'U' unsigned suffix, gcc will throw a "integer constant is
so large that it is unsigned" warning.

Signed-off-by: Kang-Che Sung <explorer09 at gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 miscutils/bc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/miscutils/bc.c b/miscutils/bc.c
index e492f0f50..92721d18f 100644
--- a/miscutils/bc.c
+++ b/miscutils/bc.c
@@ -844,10 +844,10 @@ struct globals {
 # error Strange INT_MAX
 #endif
 
-#if UINT_MAX == 4294967295
+#if UINT_MAX == 4294967295U
 # define BC_MAX_SCALE_STR  "4294967295"
 # define BC_MAX_STRING_STR "4294967294"
-#elif UINT_MAX == 18446744073709551615
+#elif UINT_MAX == 18446744073709551615U
 # define BC_MAX_SCALE_STR  "18446744073709551615"
 # define BC_MAX_STRING_STR "18446744073709551614"
 #else


More information about the busybox-cvs mailing list