From 523940c48e2c0fc6560f58bfd6f308f81ba74597 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 25 Jun 2025 13:58:31 +1000 Subject: [PATCH] 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. (cherry picked from commit 3620db5ea6f163199cf5a3ad09c32d02b374f748) --- lib/dns/rbtdb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/dns/rbtdb.c b/lib/dns/rbtdb.c index 4bd5c728b8..5de759f4dd 100644 --- a/lib/dns/rbtdb.c +++ b/lib/dns/rbtdb.c @@ -299,8 +299,10 @@ typedef ISC_LIST(dns_rbtnode_t) rbtnodelist_t; RDATASET_ATTR_STATCOUNT) != 0) #define STALE_TTL(header, rbtdb) (NXDOMAIN(header) ? 0 : rbtdb->serve_stale_ttl) +/* clang-format off : RemoveParentheses */ #define RDATASET_ATTR_GET(header, attribute) \ - (atomic_load_acquire(&(header)->attributes) & attribute) + (atomic_load_acquire(&(header)->attributes) & (attribute)) +/* clang-format on */ #define RDATASET_ATTR_SET(header, attribute) \ atomic_fetch_or_release(&(header)->attributes, attribute) #define RDATASET_ATTR_CLR(header, attribute) \