From: Remi Gacogne Date: Mon, 28 Jul 2025 15:12:14 +0000 (+0200) Subject: dnsname: Fix clang-tidy warnings X-Git-Tag: rec-5.4.0-alpha1~347^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=afbae807a3dbb00b9ac8e20daa8b5bef353a1764;p=thirdparty%2Fpdns.git dnsname: Fix clang-tidy warnings Signed-off-by: Remi Gacogne --- diff --git a/pdns/dnsname.cc b/pdns/dnsname.cc index ef1c4e621e..9d21304107 100644 --- a/pdns/dnsname.cc +++ b/pdns/dnsname.cc @@ -816,6 +816,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 ad4f31522f..019e864e1e 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));