]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Preserve brackets in DNS_SLABHEADER_GETATTR macro
authorMark Andrews <marka@isc.org>
Wed, 18 Jun 2025 02:01:31 +0000 (12:01 +1000)
committerMark Andrews <marka@isc.org>
Wed, 25 Jun 2025 02:44:22 +0000 (12:44 +1000)
We need to turn off clang-format to preserve the brackets as
'attribute' can be an expression and we need it to be evaluated
first.

Similarly we need the entire result to be evaluated independent of
the adjoining code.

lib/dns/include/dns/rdataslab.h

index 5f4c2cfba600cc4a38f17df2469f5715ec6b74b7..20e0ddcb1a919bd8864f3336a9ef5f8970520d15 100644 (file)
@@ -158,8 +158,10 @@ enum {
        DNS_SLABHEADERATTR_STALE_WINDOW = 1 << 13,
 };
 
+/* clang-format off : RemoveParentheses */
 #define DNS_SLABHEADER_GETATTR(header, attribute) \
-       (atomic_load_acquire(&(header)->attributes) & attribute)
+       (atomic_load_acquire(&(header)->attributes) & (attribute))
+/* clang-format on */
 #define DNS_SLABHEADER_SETATTR(header, attribute) \
        atomic_fetch_or_release(&(header)->attributes, attribute)
 #define DNS_SLABHEADER_CLRATTR(header, attribute) \