py, extmod: Introduce and use MP_FALLTHROUGH macro.

Newer GCC versions are able to warn about switch cases that fall
through.  This is usually a sign of a forgotten break statement, but in
the few cases where a fall through is intended we annotate it with this
macro to avoid the warning.
This commit is contained in:
Emil Renner Berthing
2019-11-28 12:47:21 +01:00
parent dde3db21fc
commit ccd92335a1
7 changed files with 16 additions and 3 deletions

View File

@@ -445,6 +445,7 @@ STATIC mp_obj_t set_unary_op(mp_unary_op_t op, mp_obj_t self_in) {
}
return MP_OBJ_NEW_SMALL_INT(hash);
}
MP_FALLTHROUGH
#endif
default:
return MP_OBJ_NULL; // op not supported