From: Ulya Trofimovich Date: Sat, 13 Jul 2019 23:01:35 +0000 (+0100) Subject: Use cast to 'void' instead of attribute 'unused', otherwise we get -Wused-but-marked... X-Git-Tag: 1.2~20 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=943aee82e3d53eb0eefa0facf785d586c499e838;p=re2c Use cast to 'void' instead of attribute 'unused', otherwise we get -Wused-but-marked-unused in debug mode. --- 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