From: Mark Andrews Date: Wed, 18 Jun 2025 02:01:31 +0000 (+1000) Subject: Preserve brackets in DNS_SLABHEADER_GETATTR macro X-Git-Tag: v9.21.10~28^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3620db5ea6f163199cf5a3ad09c32d02b374f748;p=thirdparty%2Fbind9.git Preserve brackets in DNS_SLABHEADER_GETATTR macro 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. --- diff --git a/lib/dns/include/dns/rdataslab.h b/lib/dns/include/dns/rdataslab.h index 5f4c2cfba60..20e0ddcb1a9 100644 --- a/lib/dns/include/dns/rdataslab.h +++ b/lib/dns/include/dns/rdataslab.h @@ -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) \