]> granicus.if.org Git - re2c/commitdiff
Use cast to 'void' instead of attribute 'unused', otherwise we get -Wused-but-marked...
authorUlya Trofimovich <skvadrik@gmail.com>
Sat, 13 Jul 2019 23:01:35 +0000 (00:01 +0100)
committerUlya Trofimovich <skvadrik@gmail.com>
Sat, 13 Jul 2019 23:02:35 +0000 (00:02 +0100)
lib/regexec_nfa_posix_backward.cc
lib/regexec_nfa_posix_kuklewicz.cc

index 93829b15a69b8297963dca83b89f77ed44bd269b..f9a845b3c253f327b74e88ed89dfb138989ae117 100644 (file)
@@ -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();
index e7f06fff39c02367f71da99b6748277665a526b9..99fdf54e16189ab50493ffd9ef5ea00fe49a4909 100644 (file)
@@ -274,9 +274,9 @@ int32_t khistory_t::precedence(ctx_t &ctx
         if (x.thist == y.thist) continue;
 
         std::vector<int32_t> &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<int32_t>::const_reverse_iterator