From 93ce125abe41b5527eb92e483e64cc6d1a027ba0 Mon Sep 17 00:00:00 2001
From: Damien George <damien.p.george@gmail.com>
Date: Thu, 19 Oct 2017 18:57:26 +1100
Subject: [PATCH] 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.
---
 py/argcheck.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/py/argcheck.c b/py/argcheck.c
index add6f8de8..d53bca73a 100644
--- a/py/argcheck.c
+++ b/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) {
-- 
GitLab