2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-22 10:10:06 +00:00

fix: dev: 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.

Merge branch 'colin/typepair-check-unused-warn' into 'main'

See merge request isc-projects/bind9!10860
This commit is contained in:
Colin Vidal 2025-08-18 14:28:47 +02:00
commit 6d8c0b2a8d

View File

@ -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) \