Opps... forgot to attach the patch file.
From c1cce89a15e8361244e706fc6284e5b64e5106ed Mon Sep 17 00:00:00 2001 From: Biswapriyo Nath <[email protected]> Date: Fri, 12 Jun 2020 14:25:56 +0530 Subject: [PATCH] crt/string: add parentheses to HASZERO macro to suppress gcc warning
Signed-off-by: Biswapriyo Nath <[email protected]> --- mingw-w64-crt/string/memchr.c | 2 +- mingw-w64-crt/string/strchrnul.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mingw-w64-crt/string/memchr.c b/mingw-w64-crt/string/memchr.c index e115afc..f15f2aa 100644 --- a/mingw-w64-crt/string/memchr.c +++ b/mingw-w64-crt/string/memchr.c @@ -29,7 +29,7 @@ #define ALIGN (sizeof(size_t)-1) #define ONES ((size_t)-1/UCHAR_MAX) #define HIGHS (ONES * (UCHAR_MAX/2+1)) -#define HASZERO(x) ((x)-ONES & ~(x) & HIGHS) +#define HASZERO(x) ( ((x)-ONES) & ~(x) & HIGHS ) void *memchr(const void *src, int c, size_t n) { diff --git a/mingw-w64-crt/string/strchrnul.c b/mingw-w64-crt/string/strchrnul.c index 889446a..2aa9c18 100644 --- a/mingw-w64-crt/string/strchrnul.c +++ b/mingw-w64-crt/string/strchrnul.c @@ -28,7 +28,7 @@ #define ALIGN (sizeof(size_t)) #define ONES ((size_t)-1/UCHAR_MAX) #define HIGHS (ONES * (UCHAR_MAX/2+1)) -#define HASZERO(x) ((x)-ONES & ~(x) & HIGHS) +#define HASZERO(x) ( ((x)-ONES) & ~(x) & HIGHS ) char *__strchrnul(const char *s, int c); -- 2.27.0
_______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
