From 7971f9030ae4bebe0d4a6845ed31584f8ab18103 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Sat, 8 May 2021 04:13:12 +0900 Subject: [PATCH] string-util: fix build error on aarch64 This fixes the following error: ``` In file included from ../src/basic/af-list.h:6, from ../src/basic/af-list.c:7: ../src/basic/string-util.h: In function 'char_is_cc': ../src/basic/string-util.h:133:19: error: comparison is always true due to limited range of data type [-Werror=type-limits] 133 | return (p >= 0 && p < ' ') || p == 127; | ^~ cc1: all warnings being treated as errors ``` Fixes #19543. --- src/basic/string-util.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/basic/string-util.h b/src/basic/string-util.h index 116dbd4583e..3884777792c 100644 --- a/src/basic/string-util.h +++ b/src/basic/string-util.h @@ -130,7 +130,7 @@ static inline bool _pure_ in_charset(const char *s, const char* charset) { } static inline bool char_is_cc(char p) { - return (p >= 0 && p < ' ') || p == 127; + return (uint8_t) p < ' ' || p == 127; } bool string_has_cc(const char *p, const char *ok) _pure_; -- 2.47.3