]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsname: Fix clang-tidy warnings
authorRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 28 Jul 2025 15:12:14 +0000 (17:12 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 22 Aug 2025 13:12:33 +0000 (15:12 +0200)
Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
(cherry picked from commit afbae807a3dbb00b9ac8e20daa8b5bef353a1764)
Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
pdns/dnsname.cc
pdns/test-dnsname_cc.cc

index 49ff7fea162d4c4b15f4d55830578e47a21245b3..ceb93d43dcc8051990a024c26f98431315e03e8a 100644 (file)
@@ -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;
index cf24bacd77ae625bded7136af7fc846f8dd58c75..846e08a1a662dc2710dd0f8ccd34101810fef232 100644 (file)
@@ -1038,7 +1038,7 @@ BOOST_AUTO_TEST_CASE(test_raw_data_comparison) {
   GenericDNSPacketWriter<PacketBuffer> 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<const char*>(query.data()) + sizeof(dnsheader), query.size() - sizeof(dnsheader));
     BOOST_CHECK(aroot.matches(raw));