diff options
author | Emil Renner Berthing <esmil@mailme.dk> | 2020-10-03 11:23:12 +0200 |
---|---|---|
committer | Emil Renner Berthing <esmil@mailme.dk> | 2020-10-22 11:47:36 +0200 |
commit | 9aa58cf8bac353297ff5e7b4f3331e5618046095 (patch) | |
tree | 0f36014f1e370a0797bc23da1c9c9ae4c5f77f1a /py/modmath.c | |
parent | fdd6fa389ed68a5d0761f7cb71c94db5e927d741 (diff) |
py, extmod: Add explicit initializers for default values.
When compiling with -Wextra which includes -Wmissing-field-initializers
GCC will warn that the defval field of mp_arg_val_t is not initialized.
This is just a warning as it is defined to be zero initialized, but since
it is a union it makes sense to be explicit about which member we're
going to use, so add the explicit initializers and get rid of the
warning.
Diffstat (limited to 'py/modmath.c')
-rw-r--r-- | py/modmath.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/py/modmath.c b/py/modmath.c index b7948f39e..3ab3ff334 100644 --- a/py/modmath.c +++ b/py/modmath.c @@ -206,8 +206,8 @@ MATH_FUN_1(lgamma, lgamma) STATIC mp_obj_t mp_math_isclose(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_a, ARG_b, ARG_rel_tol, ARG_abs_tol }; static const mp_arg_t allowed_args[] = { - {MP_QSTR_, MP_ARG_REQUIRED | MP_ARG_OBJ}, - {MP_QSTR_, MP_ARG_REQUIRED | MP_ARG_OBJ}, + {MP_QSTR_, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL}}, + {MP_QSTR_, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL}}, {MP_QSTR_rel_tol, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL}}, {MP_QSTR_abs_tol, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = MP_OBJ_NEW_SMALL_INT(0)}}, }; |