From 943aee82e3d53eb0eefa0facf785d586c499e838 Mon Sep 17 00:00:00 2001 From: Ulya Trofimovich Date: Sun, 14 Jul 2019 00:01:35 +0100 Subject: [PATCH] Use cast to 'void' instead of attribute 'unused', otherwise we get -Wused-but-marked-unused in debug mode. --- lib/regexec_nfa_posix_backward.cc | 5 ++--- lib/regexec_nfa_posix_kuklewicz.cc | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/regexec_nfa_posix_backward.cc b/lib/regexec_nfa_posix_backward.cc index 93829b15..f9a845b3 100644 --- a/lib/regexec_nfa_posix_backward.cc +++ b/lib/regexec_nfa_posix_backward.cc @@ -257,10 +257,9 @@ void closure_posix(psimctx_t &ctx) } } -static int32_t precedence(psimctx_t &ctx, const conf_t &x - , const conf_t &y RE2C_ATTR((unused))) +static int32_t precedence(psimctx_t &ctx, const conf_t &x, const conf_t &y) { - DASSERT(x.state == y.state); + DASSERT(x.state == y.state); (void)y; const uint32_t idx = index(x.state, ctx.nfa); const size_t ntags = ctx.nfa.tags.size(); diff --git a/lib/regexec_nfa_posix_kuklewicz.cc b/lib/regexec_nfa_posix_kuklewicz.cc index e7f06fff..99fdf54e 100644 --- a/lib/regexec_nfa_posix_kuklewicz.cc +++ b/lib/regexec_nfa_posix_kuklewicz.cc @@ -274,9 +274,9 @@ int32_t khistory_t::precedence(ctx_t &ctx if (x.thist == y.thist) continue; std::vector &p1 = ctx.history.path1, &p2 = ctx.history.path2; - const int32_t - n1 RE2C_ATTR((unused)) = subhistory_list(ctx.history, p1, x.thist, t), - n2 RE2C_ATTR((unused)) = subhistory_list(ctx.history, p2, y.thist, t); + int32_t n1, n2; + (void)(n1 = subhistory_list(ctx.history, p1, x.thist, t)); + (void)(n2 = subhistory_list(ctx.history, p2, y.thist, t)); DASSERT(n1 == n2); std::vector::const_reverse_iterator -- 2.50.1