From: Remi Gacogne Date: Fri, 24 Nov 2023 15:16:52 +0000 (+0100) Subject: dnsdist: Explain to clang-tidy that resizing a moved vector is fine X-Git-Tag: dnsdist-1.8.3~8^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=52e0c82dd08436d3baf7018ff5f2787293f4023a;p=thirdparty%2Fpdns.git dnsdist: Explain to clang-tidy that resizing a moved vector is fine (cherry picked from commit c0391c22e44f9cef35a13feaf211bbc0b16573b7) --- diff --git a/pdns/dnsdist.cc b/pdns/dnsdist.cc index d4dfbff67b..d83c2b922a 100644 --- a/pdns/dnsdist.cc +++ b/pdns/dnsdist.cc @@ -748,6 +748,7 @@ void responderThread(std::shared_ptr dss) for (const auto& fd : sockets) { /* allocate one more byte so we can detect truncation */ + // NOLINTNEXTLINE(bugprone-use-after-move): resizing a vector has no preconditions so it is valid to do so after moving it response.resize(initialBufferSize + 1); ssize_t got = recv(fd, response.data(), response.size(), 0);