From: Otto Moerbeek Date: Thu, 28 Aug 2025 07:53:53 +0000 (+0200) Subject: dnsdist: don't increment in a potential macro argument X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F16042%2Fhead;p=thirdparty%2Fpdns.git dnsdist: don't increment in a potential macro argument Fixes g++ 8: ../dnsdist-crypto.cc:291:16: warning: operation on 'count' may be undefined [-Wsequence-point] Signed-off-by: Otto Moerbeek --- diff --git a/pdns/dnsdistdist/dnsdist-crypto.cc b/pdns/dnsdistdist/dnsdist-crypto.cc index c31727b4a..c864ac8c2 100644 --- a/pdns/dnsdistdist/dnsdist-crypto.cc +++ b/pdns/dnsdistdist/dnsdist-crypto.cc @@ -287,8 +287,8 @@ void Nonce::increment() { // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) auto* ptr = reinterpret_cast(value.data()); - uint32_t count = htonl(*ptr); - *ptr = ntohl(++count); + uint32_t count = htonl(*ptr) + 1; + *ptr = ntohl(count); } #else