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: rec-5.0.0-rc1~11^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c0391c22e44f9cef35a13feaf211bbc0b16573b7;p=thirdparty%2Fpdns.git dnsdist: Explain to clang-tidy that resizing a moved vector is fine --- diff --git a/pdns/dnsdist.cc b/pdns/dnsdist.cc index 0e92d99823..8aba1e2b70 100644 --- a/pdns/dnsdist.cc +++ b/pdns/dnsdist.cc @@ -787,6 +787,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);