{
ast_expression_codegen *gen;
if (func->curblock->final && !ast_istype(self->exprs[i], ast_label)) {
- if (OPTS_FLAG(ALLOW_UNREACHABLE_CODE))
- continue;
- compile_error(ast_ctx(self->exprs[i]), "unreachable statement");
- return false;
+ if (compile_warning(ast_ctx(self->exprs[i]), WARN_UNREACHABLE_CODE, "unreachable statement"))
+ return false;
+ continue;
}
gen = self->exprs[i]->expression.codegen;
if (!(*gen)(self->exprs[i], func, false, out))
opts_set(opts.warn, WARN_CONST_VAR, true);
opts_set(opts.warn, WARN_MULTIBYTE_CHARACTER, true);
opts_set(opts.warn, WARN_UNKNOWN_PRAGMAS, true);
+ opts_set(opts.warn, WARN_UNREACHABLE_CODE, true);
/* flags */
opts_set(opts.flags, ADJUST_VECTOR_FIELDS, true);
opts_set(opts.flags, FTEPP, false);
opts_set(opts.flags, CORRECT_TERNARY, true);
- opts_set(opts.flags, ALLOW_UNREACHABLE_CODE, true);
}
void opts_init(const char *output, int standard, size_t arraysize) {
GMQCC_DEFINE_FLAG(LNO)
GMQCC_DEFINE_FLAG(CORRECT_TERNARY)
GMQCC_DEFINE_FLAG(SINGLE_VECTOR_DEFS)
- GMQCC_DEFINE_FLAG(ALLOW_UNREACHABLE_CODE)
#endif
/* warning flags */
GMQCC_DEFINE_FLAG(MULTIBYTE_CHARACTER)
GMQCC_DEFINE_FLAG(TERNARY_PRECEDENCE)
GMQCC_DEFINE_FLAG(UNKNOWN_PRAGMAS)
+ GMQCC_DEFINE_FLAG(UNREACHABLE_CODE)
#endif
#ifdef GMQCC_TYPE_OPTIMIZATIONS