compile out terse mismatch message when not used

This commit is contained in:
Jeff Epler 2022-11-08 15:40:59 -06:00
parent a94663b3c9
commit 4158ddfc17
No known key found for this signature in database
GPG Key ID: D5BF15AB975AB4DE
2 changed files with 4 additions and 0 deletions

View File

@ -145,9 +145,11 @@ 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
NORETURN void mp_arg_error_terse_mismatch(void) {
mp_raise_TypeError(MP_ERROR_TEXT("argument num/types mismatch"));
}
#endif
#if MICROPY_CPYTHON_COMPAT
NORETURN void mp_arg_error_unimpl_kw(void) {

View File

@ -91,7 +91,9 @@ static inline void mp_arg_check_num(size_t n_args, size_t n_kw, size_t n_args_mi
}
void mp_arg_parse_all(size_t n_pos, const mp_obj_t *pos, mp_map_t *kws, size_t n_allowed, const mp_arg_t *allowed, mp_arg_val_t *out_vals);
void mp_arg_parse_all_kw_array(size_t n_pos, size_t n_kw, const mp_obj_t *args, size_t n_allowed, const mp_arg_t *allowed, mp_arg_val_t *out_vals);
#if MICROPY_ERROR_REPORTING <= MICROPY_ERROR_REPORTING_TERSE
NORETURN void mp_arg_error_terse_mismatch(void);
#endif
NORETURN void mp_arg_error_unimpl_kw(void);
NORETURN void mp_arg_error_invalid(qstr arg_name);