From 6a269e10520ffd5431830e8c1ee87e464d458663 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 --- 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 c31727b4ae..c864ac8c2a 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