From fb8364826831f902b2725f95f372139fb36063f2 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Mon, 21 Dec 2020 08:35:24 +0100 Subject: [PATCH] CONTRIB: halog: mark the has_zero* functions unused These ones will depend on the use of memchr() or not, let's mark them unused to avoid the warning reported in issue #1013. (cherry picked from commit f531dfff18becc87a3855ae6bc987afe9bffccc3) Signed-off-by: Christopher Faulet (cherry picked from commit 9080ac02583d90f99544a389353538c1e68ad8cf) Signed-off-by: Christopher Faulet (cherry picked from commit 0c2916b0c7462fab24a2ccea87dcc8b6f123c2ac) Signed-off-by: Christopher Faulet --- contrib/halog/fgets2.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/halog/fgets2.c b/contrib/halog/fgets2.c index 3db762c..776a915 100644 --- a/contrib/halog/fgets2.c +++ b/contrib/halog/fgets2.c @@ -35,7 +35,7 @@ #endif /* return non-zero if the integer contains at least one zero byte */ -static inline unsigned int has_zero32(unsigned int x) +static inline __attribute__((unused)) unsigned int has_zero32(unsigned int x) { unsigned int y; @@ -72,7 +72,7 @@ static inline unsigned int has_zero32(unsigned int x) } /* return non-zero if the argument contains at least one zero byte. See principle above. */ -static inline unsigned long long has_zero64(unsigned long long x) +static inline __attribute__((unused)) unsigned long long has_zero64(unsigned long long x) { unsigned long long y; @@ -81,7 +81,7 @@ static inline unsigned long long has_zero64(unsigned long long x) return y & 0x8080808080808080ULL; } -static inline unsigned long has_zero(unsigned long x) +static inline __attribute__((unused)) unsigned long has_zero(unsigned long x) { return (sizeof(x) == 8) ? has_zero64(x) : has_zero32(x); } -- 1.7.10.4