From fd8624354b120b2a64234f9f23a7b18db8cac1f1 Mon Sep 17 00:00:00 2001 From: Colin Vidal Date: Mon, 18 Aug 2025 11:23:19 +0200 Subject: [PATCH] remove unused warning if DNS_TYPEPAIR_CHECK is off The compile-time DNS__TYPEPAIR_CHECK macro (wrapping an INSIST) is a no-op if DNS_TYPEPAIR_CHECK is off, making at least one unused variable in DNS_TYPEPAIR_TYPE and DNS_TYPEPAIR_COVERS scopes (as in such case, only one member of the pair is effectively needed). In such case, having an unused variable (the other member of the pair) is expected, this silence the warning by adding a (void) cast on the no-op version of DNS__TYPEPAIR_CHECK. --- lib/dns/include/dns/rdatatype.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dns/include/dns/rdatatype.h b/lib/dns/include/dns/rdatatype.h index 07ff817b57..1822daef07 100644 --- a/lib/dns/include/dns/rdatatype.h +++ b/lib/dns/include/dns/rdatatype.h @@ -23,7 +23,7 @@ (base == dns_rdatatype_none && covers != dns_rdatatype_none) || \ (base != dns_rdatatype_none && covers == dns_rdatatype_none)) #else -#define DNS__TYPEPAIR_CHECK(base, covers) +#define DNS__TYPEPAIR_CHECK(base, covers) (void)(base), (void)(covers) #endif #define DNS_TYPEPAIR_TYPE(type) \