From: Willy Tarreau Date: Fri, 16 May 2025 14:19:04 +0000 (+0200) Subject: IMPORT: slz: silence a build warning on non-x86 non-arm X-Git-Tag: v3.2-dev17~31 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ccc65012d35908f36d9516420203f3a2fd808052;p=thirdparty%2Fhaproxy.git IMPORT: slz: silence a build warning on non-x86 non-arm Building with clang 16 on MIPS64 yields this warning: src/slz.c:931:24: warning: unused function 'crc32_uint32' [-Wunused-function] static inline uint32_t crc32_uint32(uint32_t data) ^ Let's guard it using UNALIGNED_LE_OK which is the only case where it's used. This saves us from introducing a possibly non-portable attribute. This is libslz upstream commit f5727531dba8906842cb91a75c1ffa85685a6421. --- diff --git a/src/slz.c b/src/slz.c index c104a7326..002b345f8 100644 --- a/src/slz.c +++ b/src/slz.c @@ -937,6 +937,7 @@ static inline uint32_t crc32_char(uint32_t crc, uint8_t x) return crc; } +#ifdef UNALIGNED_LE_OK static inline uint32_t crc32_uint32(uint32_t data) { #if defined(__ARM_FEATURE_CRC32) @@ -956,6 +957,7 @@ static inline uint32_t crc32_uint32(uint32_t data) #endif return data; } +#endif /* Modified version originally from RFC1952, working with non-inverting CRCs */ uint32_t slz_crc32_by1(uint32_t crc, const unsigned char *buf, int len)