Skip to content

Commit ccc6501

Browse files
committed
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.
1 parent 31ca29e commit ccc6501

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/slz.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -937,6 +937,7 @@ static inline uint32_t crc32_char(uint32_t crc, uint8_t x)
937937
return crc;
938938
}
939939

940+
#ifdef UNALIGNED_LE_OK
940941
static inline uint32_t crc32_uint32(uint32_t data)
941942
{
942943
#if defined(__ARM_FEATURE_CRC32)
@@ -956,6 +957,7 @@ static inline uint32_t crc32_uint32(uint32_t data)
956957
#endif
957958
return data;
958959
}
960+
#endif
959961

960962
/* Modified version originally from RFC1952, working with non-inverting CRCs */
961963
uint32_t slz_crc32_by1(uint32_t crc, const unsigned char *buf, int len)

0 commit comments

Comments
 (0)