From: Ulya Trofimovich Date: Mon, 31 Jul 2017 11:40:07 +0000 (+0100) Subject: Fixed MINGW warnings. X-Git-Tag: 1.0~35 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5d44c6d4fa3a064a06a35324fa2d020b21dc7689;p=re2c Fixed MINGW warnings. --- diff --git a/re2c/src/ast/ast.cc b/re2c/src/ast/ast.cc index b8b5e0d8..710a6024 100644 --- a/re2c/src/ast/ast.cc +++ b/re2c/src/ast/ast.cc @@ -138,7 +138,7 @@ bool ast_need_wrap(const AST *ast) case AST::REF: return true; } - assert(false); + return false; /* unreachable */ } } // namespace re2c diff --git a/re2c/src/code/go_construct.cc b/re2c/src/code/go_construct.cc index 609cc958..9a4d46f2 100644 --- a/re2c/src/code/go_construct.cc +++ b/re2c/src/code/go_construct.cc @@ -25,7 +25,7 @@ bool consume(const State *s) case Action::INITIAL: case Action::SAVE: return true; } - assert(false); + return true; /* unreachable */ } Cases::Cases(const Span *spans, uint32_t nspans, bool skip) diff --git a/re2c/src/nfa/estimate_size.cc b/re2c/src/nfa/estimate_size.cc index e82c59d4..32663b8d 100644 --- a/re2c/src/nfa/estimate_size.cc +++ b/re2c/src/nfa/estimate_size.cc @@ -25,7 +25,7 @@ static size_t estimate(const RE *re) : iter * max + (max - min); } } - assert(false); + return 0; /* unreachable */ } size_t estimate_size(const std::vector &res) diff --git a/re2c/src/re/ast_to_re.cc b/re2c/src/re/ast_to_re.cc index ac3ffa86..7c97ac89 100644 --- a/re2c/src/re/ast_to_re.cc +++ b/re2c/src/re/ast_to_re.cc @@ -47,7 +47,7 @@ static bool has_tags(const AST *ast) case AST::REF: return has_tags(ast->ref.ast); case AST::ITER: return has_tags(ast->iter.ast); } - assert(false); + return false; /* unreachable */ } static size_t fixlen(const AST *ast) @@ -82,7 +82,7 @@ static size_t fixlen(const AST *ast) } case AST::CAP: return fixlen(ast->cap); } - assert(false); + return Tag::VARDIST; /* unreachable */ } static RE *ast_to_re(RESpec &spec, const AST *ast, size_t &ncap) @@ -252,7 +252,7 @@ static RE *ast_to_re(RESpec &spec, const AST *ast, size_t &ncap) return y; } } - assert(false); + return NULL; /* unreachable */ } RE *re_schar(RE::alc_t &alc, uint32_t line, uint32_t column, uint32_t c, const opt_t *opts) @@ -271,7 +271,7 @@ RE *re_schar(RE::alc_t &alc, uint32_t line, uint32_t column, uint32_t c, const o case Enc::UCS2: return re_sym(alc, Range::sym(c)); } - assert(false); + return NULL; /* unreachable */ } RE *re_ichar(RE::alc_t &alc, uint32_t line, uint32_t column, uint32_t c, const opt_t *opts) @@ -310,7 +310,7 @@ RE *re_class(RE::alc_t &alc, uint32_t line, uint32_t column, const Range *r, con case Enc::UCS2: return re_sym(alc, r); } - assert(false); + return NULL; /* unreachable */ } static void assert_tags_used_once(const Rule &rule, const std::vector &tags) diff --git a/re2c/src/re/nullable.cc b/re2c/src/re/nullable.cc index 6201a2ee..9aa7c521 100644 --- a/re2c/src/re/nullable.cc +++ b/re2c/src/re/nullable.cc @@ -21,7 +21,7 @@ static bool nullable(const RESpec &spec, const RE *re, bool &trail) return nullable(spec, re->cat.re1, trail) && nullable(spec, re->cat.re2, trail); } - assert(false); + return false; /* unreachable */ } /*