10000 py/argcheck: Remove #if guard around terse error message helper func. · micropython/micropython-esp32@93ce125 · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Sep 6, 2023. It is now read-only.

Commit 93ce125

Browse files
committed
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.
1 parent d6bf365 commit 93ce125

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

py/argcheck.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,9 @@ void mp_arg_parse_all_kw_array(size_t n_pos, size_t n_kw, const mp_obj_t *args,
133133
mp_arg_parse_all(n_pos, args, &kw_args, n_allowed, allowed, out_vals);
134134
}
135135

136-
#if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE || _MSC_VER
137136
NORETURN void mp_arg_error_terse_mismatch(void) {
138137
mp_raise_TypeError("argument num/types mismatch");
139138
}
140-
#endif
141139

142140
#if MICROPY_CPYTHON_COMPAT
143141
NORETURN void mp_arg_error_unimpl_kw(void) {

0 commit comments

Comments
 (0)
0