From 257cb68e5b46a17525761f1a0f24f50f2ed5e1fe Mon Sep 17 00:00:00 2001 From: Michal Nowak Date: Tue, 24 Feb 2026 20:56:54 +0100 Subject: [PATCH 1/3] Add LLVM 22 (cherry picked from commit ffd7636e79023eadeacf52cf88c471c885f7be88) --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 82bf94b216..bf56801afa 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -21,7 +21,7 @@ variables: TEST_PARALLEL_JOBS: 4 CONFIGURE: ./configure - CLANG_VERSION: 21 + CLANG_VERSION: 22 CLANG: "clang-${CLANG_VERSION}" SCAN_BUILD: "scan-build-${CLANG_VERSION}" LLVM_SYMBOLIZER: "/usr/lib/llvm-${CLANG_VERSION}/bin/llvm-symbolizer" From 82991c78816fb9a70a171329cc1c1a4ae6dc2ebe Mon Sep 17 00:00:00 2001 From: Michal Nowak Date: Wed, 4 Mar 2026 12:17:00 +0100 Subject: [PATCH 2/3] Use clang-format-22 to update formatting (cherry picked from commit 239464f27643bf609e9c0ad79ab2d597ccbb2280) --- bin/named/statschannel.c | 4 ++-- lib/dns/adb.c | 10 +++++----- lib/dns/include/dns/message.h | 2 +- lib/dns/include/dns/sdlz.h | 4 ++-- lib/dns/time.c | 4 ++-- lib/dns/zone.c | 2 +- lib/isc/include/isc/overflow.h | 2 +- lib/isc/include/isc/queue.h | 4 ++-- lib/isc/include/isc/quota.h | 2 +- lib/isc/include/isc/refcount.h | 2 +- lib/ns/include/ns/client.h | 16 ++++++++-------- tests/isc/file_test.c | 4 ++-- 12 files changed, 28 insertions(+), 28 deletions(-) diff --git a/bin/named/statschannel.c b/bin/named/statschannel.c index ff8074fc17..4a7662ea0c 100644 --- a/bin/named/statschannel.c +++ b/bin/named/statschannel.c @@ -58,11 +58,11 @@ #define STATS_XML_VERSION_MAJOR "3" #define STATS_XML_VERSION_MINOR "14" -#define STATS_XML_VERSION STATS_XML_VERSION_MAJOR "." STATS_XML_VERSION_MINOR +#define STATS_XML_VERSION STATS_XML_VERSION_MAJOR "." STATS_XML_VERSION_MINOR #define STATS_JSON_VERSION_MAJOR "1" #define STATS_JSON_VERSION_MINOR "8" -#define STATS_JSON_VERSION STATS_JSON_VERSION_MAJOR "." STATS_JSON_VERSION_MINOR +#define STATS_JSON_VERSION STATS_JSON_VERSION_MAJOR "." STATS_JSON_VERSION_MINOR struct named_statschannel { /* Unlocked */ diff --git a/lib/dns/adb.c b/lib/dns/adb.c index 488ce4ff6e..00471556cb 100644 --- a/lib/dns/adb.c +++ b/lib/dns/adb.c @@ -416,11 +416,11 @@ enum { */ #define FIND_WANTEVENT(fn) (((fn)->options & DNS_ADBFIND_WANTEVENT) != 0) #define FIND_WANTEMPTYEVENT(fn) (((fn)->options & DNS_ADBFIND_EMPTYEVENT) != 0) -#define FIND_AVOIDFETCHES(fn) (((fn)->options & DNS_ADBFIND_AVOIDFETCHES) != 0) -#define FIND_STARTATZONE(fn) (((fn)->options & DNS_ADBFIND_STARTATZONE) != 0) -#define FIND_STATICSTUB(fn) (((fn)->options & DNS_ADBFIND_STATICSTUB) != 0) -#define FIND_HAS_ADDRS(fn) (!ISC_LIST_EMPTY((fn)->list)) -#define FIND_NOFETCH(fn) (((fn)->options & DNS_ADBFIND_NOFETCH) != 0) +#define FIND_AVOIDFETCHES(fn) (((fn)->options & DNS_ADBFIND_AVOIDFETCHES) != 0) +#define FIND_STARTATZONE(fn) (((fn)->options & DNS_ADBFIND_STARTATZONE) != 0) +#define FIND_STATICSTUB(fn) (((fn)->options & DNS_ADBFIND_STATICSTUB) != 0) +#define FIND_HAS_ADDRS(fn) (!ISC_LIST_EMPTY((fn)->list)) +#define FIND_NOFETCH(fn) (((fn)->options & DNS_ADBFIND_NOFETCH) != 0) #define ADBNAME_TYPE_MASK (DNS_ADBFIND_STARTATZONE | DNS_ADBFIND_STATICSTUB) diff --git a/lib/dns/include/dns/message.h b/lib/dns/include/dns/message.h index a3ad4ba2ad..e2bae5d9c2 100644 --- a/lib/dns/include/dns/message.h +++ b/lib/dns/include/dns/message.h @@ -133,7 +133,7 @@ */ #define DNS_EDNSOPTIONS 7 + DNS_EDE_MAX_ERRORS -#define DNS_MESSAGE_REPLYPRESERVE (DNS_MESSAGEFLAG_RD | DNS_MESSAGEFLAG_CD) +#define DNS_MESSAGE_REPLYPRESERVE (DNS_MESSAGEFLAG_RD | DNS_MESSAGEFLAG_CD) #define DNS_MESSAGEEXTFLAG_REPLYPRESERVE (DNS_MESSAGEEXTFLAG_DO) #define DNS_MESSAGE_HEADERLEN 12 /*%< 6 uint16_t's */ diff --git a/lib/dns/include/dns/sdlz.h b/lib/dns/include/dns/sdlz.h index b0388b98cf..2ba66e7ed5 100644 --- a/lib/dns/include/dns/sdlz.h +++ b/lib/dns/include/dns/sdlz.h @@ -332,8 +332,8 @@ dns_sdlz_putrr_t dns_sdlz_putrr; */ typedef isc_result_t - dns_sdlz_putsoa_t(dns_sdlzlookup_t *lookup, const char *mname, - const char *rname, uint32_t serial); +dns_sdlz_putsoa_t(dns_sdlzlookup_t *lookup, const char *mname, + const char *rname, uint32_t serial); dns_sdlz_putsoa_t dns_sdlz_putsoa; /*%< * This function may optionally be called from the 'authority' diff --git a/lib/dns/time.c b/lib/dns/time.c index ae23ce0a99..dc1db73fb2 100644 --- a/lib/dns/time.c +++ b/lib/dns/time.c @@ -41,8 +41,8 @@ dns_time64_totext(int64_t t, isc_buffer_t *target) { /* * Warning. Do NOT use arguments with side effects with these macros. */ -#define is_leap(y) ((((y) % 4) == 0 && ((y) % 100) != 0) || ((y) % 400) == 0) -#define year_secs(y) ((is_leap(y) ? 366 : 365) * 86400) +#define is_leap(y) ((((y) % 4) == 0 && ((y) % 100) != 0) || ((y) % 400) == 0) +#define year_secs(y) ((is_leap(y) ? 366 : 365) * 86400) #define month_secs(m, y) ((days[m] + ((m == 1 && is_leap(y)) ? 1 : 0)) * 86400) tm.tm_year = 70; diff --git a/lib/dns/zone.c b/lib/dns/zone.c index 2079168fe3..40b0e1fdad 100644 --- a/lib/dns/zone.c +++ b/lib/dns/zone.c @@ -571,7 +571,7 @@ typedef enum { DNS_ZONEFLG___MAX = UINT64_MAX, /* trick to make the ENUM 64-bit wide */ } dns_zoneflg_t; -#define DNS_ZONE_OPTION(z, o) ((atomic_load_relaxed(&(z)->options) & (o)) != 0) +#define DNS_ZONE_OPTION(z, o) ((atomic_load_relaxed(&(z)->options) & (o)) != 0) #define DNS_ZONE_SETOPTION(z, o) atomic_fetch_or(&(z)->options, (o)) #define DNS_ZONE_CLROPTION(z, o) atomic_fetch_and(&(z)->options, ~(o)) diff --git a/lib/isc/include/isc/overflow.h b/lib/isc/include/isc/overflow.h index c272cfa879..70c9169533 100644 --- a/lib/isc/include/isc/overflow.h +++ b/lib/isc/include/isc/overflow.h @@ -89,7 +89,7 @@ ({ \ size_t _d; \ bool _overflow = ISC_OVERFLOW_MUL(a, b, &_d) || \ - ISC_OVERFLOW_ADD(_d, c, &_d); \ + ISC_OVERFLOW_ADD(_d, c, &_d); \ INSIST(!_overflow); \ _d; \ }) diff --git a/lib/isc/include/isc/queue.h b/lib/isc/include/isc/queue.h index a2abe24c15..02f94d866d 100644 --- a/lib/isc/include/isc/queue.h +++ b/lib/isc/include/isc/queue.h @@ -21,10 +21,10 @@ STATIC_ASSERT(sizeof(struct __cds_wfcq_head) <= ISC_OS_CACHELINE_SIZE, typedef struct isc_queue { struct __cds_wfcq_head head; uint8_t __padding_head[ISC_OS_CACHELINE_SIZE - - sizeof(struct __cds_wfcq_head)]; + sizeof(struct __cds_wfcq_head)]; struct cds_wfcq_tail tail; uint8_t __padding_tail[ISC_OS_CACHELINE_SIZE - - sizeof(struct __cds_wfcq_head)]; + sizeof(struct __cds_wfcq_head)]; } isc_queue_t; typedef struct cds_wfcq_node isc_queue_node_t; diff --git a/lib/isc/include/isc/quota.h b/lib/isc/include/isc/quota.h index 5597b9fda1..ff0c281aa7 100644 --- a/lib/isc/include/isc/quota.h +++ b/lib/isc/include/isc/quota.h @@ -67,7 +67,7 @@ struct isc_quota { struct { struct cds_wfcq_head head; uint8_t __padding[ISC_OS_CACHELINE_SIZE - - sizeof(struct __cds_wfcq_head)]; + sizeof(struct __cds_wfcq_head)]; struct cds_wfcq_tail tail; } jobs; ISC_LINK(isc_quota_t) link; diff --git a/lib/isc/include/isc/refcount.h b/lib/isc/include/isc/refcount.h index 82f5796bd6..81c5bc79a4 100644 --- a/lib/isc/include/isc/refcount.h +++ b/lib/isc/include/isc/refcount.h @@ -201,7 +201,7 @@ typedef atomic_uint_fast32_t isc_refcount_t; __attribute__((unused)); \ stat void name##_detach(name##_t **ptrp) __attribute__((unused)) -#define ISC_REFCOUNT_DECL(name) ISC__REFCOUNT_DECL(name, ISC_REFCOUNT_BLANK) +#define ISC_REFCOUNT_DECL(name) ISC__REFCOUNT_DECL(name, ISC_REFCOUNT_BLANK) #define ISC_REFCOUNT_STATIC_DECL(name) ISC__REFCOUNT_DECL(name, static inline) #define ISC__REFCOUNT_IMPL(name, destroy, stat) \ diff --git a/lib/ns/include/ns/client.h b/lib/ns/include/ns/client.h index 440febcc05..e813897d2f 100644 --- a/lib/ns/include/ns/client.h +++ b/lib/ns/include/ns/client.h @@ -248,14 +248,14 @@ struct ns_client { #define NS_CLIENTATTR_BADCOOKIE \ 0x00040 /*%< Presented cookie is bad/out-of-date */ /* Obsolete: NS_CLIENTATTR_FILTER_AAAA_RC 0x00080 */ -#define NS_CLIENTATTR_WANTAD 0x00100 /*%< want AD in response if possible */ -#define NS_CLIENTATTR_WANTCOOKIE 0x00200 /*%< return a COOKIE */ -#define NS_CLIENTATTR_HAVECOOKIE 0x00400 /*%< has a valid COOKIE */ -#define NS_CLIENTATTR_WANTEXPIRE 0x00800 /*%< return seconds to expire */ -#define NS_CLIENTATTR_HAVEEXPIRE 0x01000 /*%< return seconds to expire */ -#define NS_CLIENTATTR_WANTOPT 0x02000 /*%< add opt to reply */ -#define NS_CLIENTATTR_HAVEECS 0x04000 /*%< received an ECS option */ -#define NS_CLIENTATTR_WANTPAD 0x08000 /*%< pad reply */ +#define NS_CLIENTATTR_WANTAD 0x00100 /*%< want AD in response if possible */ +#define NS_CLIENTATTR_WANTCOOKIE 0x00200 /*%< return a COOKIE */ +#define NS_CLIENTATTR_HAVECOOKIE 0x00400 /*%< has a valid COOKIE */ +#define NS_CLIENTATTR_WANTEXPIRE 0x00800 /*%< return seconds to expire */ +#define NS_CLIENTATTR_HAVEEXPIRE 0x01000 /*%< return seconds to expire */ +#define NS_CLIENTATTR_WANTOPT 0x02000 /*%< add opt to reply */ +#define NS_CLIENTATTR_HAVEECS 0x04000 /*%< received an ECS option */ +#define NS_CLIENTATTR_WANTPAD 0x08000 /*%< pad reply */ #define NS_CLIENTATTR_USEKEEPALIVE 0x10000 /*%< use TCP keepalive */ #define NS_CLIENTATTR_NOSETFC 0x20000 /*%< don't set servfail cache */ diff --git a/tests/isc/file_test.c b/tests/isc/file_test.c index 6b75ba2490..03c401409e 100644 --- a/tests/isc/file_test.c +++ b/tests/isc/file_test.c @@ -30,8 +30,8 @@ #include -#define NAME "internal" -#define SHA "3bed2cb3a3acf7b6a8ef408420cc682d5520e26976d354254f528c965612054f" +#define NAME "internal" +#define SHA "3bed2cb3a3acf7b6a8ef408420cc682d5520e26976d354254f528c965612054f" #define TRUNC_SHA "3bed2cb3a3acf7b6" #define BAD1 "in/internal" From 7795fa70dc3231b8a61c320a5c66ced8fcf411a6 Mon Sep 17 00:00:00 2001 From: Michal Nowak Date: Wed, 4 Mar 2026 10:58:15 +0100 Subject: [PATCH 3/3] Ignore clang-format-22 reformatting commits (cherry picked from commit 01d16e049e7673724800661fbbe7d75c4fe0e591) --- .git-blame-ignore-revs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index f76db62c66..43a4555795 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -1554,3 +1554,5 @@ c22176c0f9a71217be9bfab00573f8f0265499af 58791b5cfe8d6d17e05a450fb9cf72cc52472541 # Use ControlStatementsExceptControlMacros for SpaceBeforeParens 8f8fb10232eabcee1d78efb52623a07d6326cdb6 +# Use clang-format-22 to update formatting +82991c78816fb9a70a171329cc1c1a4ae6dc2ebe