From 1eb642832fdda15883d1405af1045624502ce0de Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Mon, 28 Jul 2025 17:12:14 +0200 Subject: [PATCH] dnsname: Fix clang-tidy warnings Signed-off-by: Remi Gacogne (cherry picked from commit afbae807a3dbb00b9ac8e20daa8b5bef353a1764) Signed-off-by: Remi Gacogne --- pdns/dnsname.cc | 1 + pdns/test-dnsname_cc.cc | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pdns/dnsname.cc b/pdns/dnsname.cc index 49ff7fea1..ceb93d43d 100644 --- a/pdns/dnsname.cc +++ b/pdns/dnsname.cc @@ -740,6 +740,7 @@ bool DNSName::matches(const std::string_view& wire_uncompressed) const const auto* our = d_storage.cbegin(); const auto* other = wire_uncompressed.cbegin(); + // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic) for (; our != d_storage.cend() && other != wire_uncompressed.cend(); ++our, ++other) { if (dns_tolower(*other) != dns_tolower(*our)) { return false; diff --git a/pdns/test-dnsname_cc.cc b/pdns/test-dnsname_cc.cc index cf24bacd7..846e08a1a 100644 --- a/pdns/test-dnsname_cc.cc +++ b/pdns/test-dnsname_cc.cc @@ -1038,7 +1038,7 @@ BOOST_AUTO_TEST_CASE(test_raw_data_comparison) { GenericDNSPacketWriter packetWriter(query, aroot, QType::A, QClass::IN, 0); { - // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast,cppcoreguidelines-pro-bounds-pointer-arithmetic) const std::string_view raw(reinterpret_cast(query.data()) + sizeof(dnsheader), query.size() - sizeof(dnsheader)); BOOST_CHECK(aroot.matches(raw)); -- 2.47.3