From: Remi Gacogne Date: Mon, 28 Jul 2025 15:12:14 +0000 (+0200) Subject: dnsname: Fix clang-tidy warnings X-Git-Tag: dnsdist-2.0.1~15^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1eb642832fdda15883d1405af1045624502ce0de;p=thirdparty%2Fpdns.git dnsname: Fix clang-tidy warnings Signed-off-by: Remi Gacogne (cherry picked from commit afbae807a3dbb00b9ac8e20daa8b5bef353a1764) Signed-off-by: Remi Gacogne --- 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));