]> granicus.if.org Git - re2c/commitdiff
libre2c: avoid -Wreturn compiler warnings (no return value from non-void function).
authorUlya Trofimovich <skvadrik@gmail.com>
Tue, 19 Feb 2019 15:59:20 +0000 (15:59 +0000)
committerUlya Trofimovich <skvadrik@gmail.com>
Tue, 19 Feb 2019 15:59:20 +0000 (15:59 +0000)
re2c/lib/regexec_nfa_posix.cc
re2c/lib/regexec_nfa_posix_trie.cc

index da241885c177e6a30d5cc24fb69d28a67fab7eac..6ee281f7f52fc3148f8fde51c7422d4ea1bbe7ad 100644 (file)
@@ -463,12 +463,13 @@ int32_t precedence(simctx_t &ctx, const conf_t &x, const conf_t &y
         // positive vs negative: positive wins
         if (neg1) return  1;
         if (neg2) return -1;
-
-        DASSERT(false);
     }
     else {
         return unpack_leftmost(ctx.prectbl1[orig1 * ctx.nfa->ncores + orig2]);
     }
+
+    DASSERT(false); // unreachable
+    return 0;
 }
 
 } // namespace libre2c
index 7f6e66248290a1cbb8d2c30aa3d3f8d16c9794f2..3a05beadd1ae99a9fb6462b1b143f28e1b5fe15c 100644 (file)
@@ -316,12 +316,13 @@ int32_t precedence_(simctx_t &ctx, int32_t idx1, int32_t idx2
         // positive vs negative: positive wins
         if (neg1) return  1;
         if (neg2) return -1;
-
-        DASSERT(false);
     }
     else {
         return prec;
     }
+
+    DASSERT(false); // unreachable
+    return 0;
 }
 
 uint32_t get_step(const history_t &hist, int32_t idx)