From 65c59f78e4b7dfa25e3c8b7d68358f6e5f71a2bf Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Thu, 28 Aug 2025 09:53:53 +0200 Subject: [PATCH] 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 (cherry picked from commit 6a269e10520ffd5431830e8c1ee87e464d458663) --- pdns/dnsdistdist/dnsdist-crypto.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pdns/dnsdistdist/dnsdist-crypto.cc b/pdns/dnsdistdist/dnsdist-crypto.cc index df4beebcb2..662a701ef8 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 -- 2.47.3