From: Bruno Haible Date: Sun, 16 Aug 2020 11:00:51 +0000 (+0200) Subject: Fix "warning: integer overflow in expression". X-Git-Tag: v1.0~3740 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=76361a07d79633619849478e7c3b0859e548d85c;p=gnulib.git Fix "warning: integer overflow in expression". * tests/test-strtol.c (main): Use an 'unsigned long' expression to remove a 'long' overflow. --- diff --git a/ChangeLog b/ChangeLog index 56e893b13d..696aefc76d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2020-08-16 Bruno Haible + Fix "warning: integer overflow in expression". + * tests/test-strtol.c (main): Use an 'unsigned long' expression to + remove a 'long' overflow. + Fix "warning: "getpagesize" redefined". * tests/test-getcwd.c (getpagesize): Don't redefine if defined as a macro. diff --git a/tests/test-strtol.c b/tests/test-strtol.c index 8d523c25da..d33ac12f50 100644 --- a/tests/test-strtol.c +++ b/tests/test-strtol.c @@ -172,7 +172,7 @@ main (void) long result; errno = 0; result = strtol (input, &ptr, 10); - ASSERT (result == 65535L * 65537L); + ASSERT (result == (long) 4294967295UL); ASSERT (ptr == input + 10); ASSERT (errno == 0); }