Browse Source

py/argcheck: Remove #if guard around terse error message helper func.

Not all compilers/analysers are smart enough to realise that this function
is never called if MICROPY_ERROR_REPORTING is not TERSE, because the logic
in the code uses if statements rather than #if to select whether to call
this function or not (MSC in debug mode is an example of this, but there
are others).  So just unconditionally compile this helper function.  The
code-base anyway relies on the linker to remove unused functions.
pull/3377/head
Damien George 7 years ago
parent
commit
93ce125abe
  1. 2
      py/argcheck.c

2
py/argcheck.c

@ -133,11 +133,9 @@ void mp_arg_parse_all_kw_array(size_t n_pos, size_t n_kw, const mp_obj_t *args,
mp_arg_parse_all(n_pos, args, &kw_args, n_allowed, allowed, out_vals);
}
#if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE || _MSC_VER
NORETURN void mp_arg_error_terse_mismatch(void) {
mp_raise_TypeError("argument num/types mismatch");
}
#endif
#if MICROPY_CPYTHON_COMPAT
NORETURN void mp_arg_error_unimpl_kw(void) {

Loading…
Cancel
Save