# HG changeset patch # User Mike Becker # Date 1757152637 -7200 # Node ID 556e4e7608b1fc69b7759c302466a1a6c7da0453 # Parent c9a86bd9e361bc1cc52d33f0047626ce9ee20026 fix that the fallthrough attributes were not abstracted by the cx_attr macros diff -r c9a86bd9e361 -r 556e4e7608b1 src/cx/common.h --- a/src/cx/common.h Wed Sep 03 23:10:36 2025 +0200 +++ b/src/cx/common.h Sat Sep 06 11:57:17 2025 +0200 @@ -131,6 +131,11 @@ #endif /** + * Inform the compiler that falling through a switch case is intentional. + */ +#define cx_attr_fallthrough __attribute__((__fallthrough__)) + +/** * All pointer arguments must be non-NULL. */ #define cx_attr_nonnull __attribute__((__nonnull__)) diff -r c9a86bd9e361 -r 556e4e7608b1 src/hash_key.c --- a/src/hash_key.c Wed Sep 03 23:10:36 2025 +0200 +++ b/src/hash_key.c Sat Sep 06 11:57:17 2025 +0200 @@ -62,14 +62,14 @@ switch (len) { case 3: h ^= (data[i + 2] & 0xFF) << 16; - __attribute__((__fallthrough__)); + cx_attr_fallthrough; case 2: h ^= (data[i + 1] & 0xFF) << 8; - __attribute__((__fallthrough__)); + cx_attr_fallthrough; case 1: h ^= (data[i + 0] & 0xFF); h *= m; - __attribute__((__fallthrough__)); + cx_attr_fallthrough; default: // do nothing ; }