From: Ulya Trofimovich Date: Tue, 19 Feb 2019 15:59:20 +0000 (+0000) Subject: libre2c: avoid -Wreturn compiler warnings (no return value from non-void function). X-Git-Tag: 1.2~150 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fd4957db85fee6d5bceefb5fef4dbb1ad1bea48e;p=re2c libre2c: avoid -Wreturn compiler warnings (no return value from non-void function). --- diff --git a/re2c/lib/regexec_nfa_posix.cc b/re2c/lib/regexec_nfa_posix.cc index da241885..6ee281f7 100644 --- a/re2c/lib/regexec_nfa_posix.cc +++ b/re2c/lib/regexec_nfa_posix.cc @@ -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 diff --git a/re2c/lib/regexec_nfa_posix_trie.cc b/re2c/lib/regexec_nfa_posix_trie.cc index 7f6e6624..3a05bead 100644 --- a/re2c/lib/regexec_nfa_posix_trie.cc +++ b/re2c/lib/regexec_nfa_posix_trie.cc @@ -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)