+2024-09-08 Jim Meyering <meyering@meta.com>
+
+ crc.h: declare each function with _GL_ATTRIBUTE_PURE
+ * lib/crc.h (crc32, crc32_update, crc32_no_xor)
+ (crc32_update_no_xor): Declare with _GL_ATTRIBUTE_PURE.
+
2024-09-05 Paul Eggert <eggert@cs.ucla.edu>
Fix COPYING.EXCEPTION license notices
/* Compute CRC-32 value of LEN bytes long BUF, and return it. */
-extern uint32_t crc32 (const char *buf, size_t len);
+extern uint32_t crc32 (const char *buf, size_t len) _GL_ATTRIBUTE_PURE;
/* Incrementally update CRC-32 value CRC using LEN bytes long BUF. In
the first call, use 0 as the value for CRC. Return the updated
CRC-32 value. */
-extern uint32_t crc32_update (uint32_t crc, const char *buf, size_t len);
+extern uint32_t crc32_update (uint32_t crc, const char *buf, size_t len)
+ _GL_ATTRIBUTE_PURE;
/* Compute modified-CRC-32 value of LEN bytes long BUF, and return it.
The "modification" is to avoid the initial and final XOR operation.
Due to historic implementation errors, this variant is sometimes
used (i.e., in RFC 3961). */
-extern uint32_t crc32_no_xor (const char *buf, size_t len);
+extern uint32_t crc32_no_xor (const char *buf, size_t len)
+ _GL_ATTRIBUTE_PURE;
/* Incrementally update modified-CRC-32 value CRC using LEN bytes long
BUF. In the first call, use 0 as the value for CRC. Return the
initial and final XOR operation. Due to historic implementation
errors, this variant is sometimes used (i.e., in RFC 3961). */
extern uint32_t
-crc32_update_no_xor (uint32_t crc, const char *buf, size_t len);
+crc32_update_no_xor (uint32_t crc, const char *buf, size_t len)
+ _GL_ATTRIBUTE_PURE;
#ifdef __cplusplus