diff --git a/lib/main/dyad/dyad.c b/lib/main/dyad/dyad.c index b7bfd68e13..bb7f2cbbdc 100644 --- a/lib/main/dyad/dyad.c +++ b/lib/main/dyad/dyad.c @@ -5,6 +5,12 @@ * under the terms of the MIT license. See LICENSE for details. */ +#if __GNUC__ > 6 +#define FALLTHROUGH __attribute__ ((fallthrough)) +#else +#define FALLTHROUGH do {} while(0) +#endif + #ifdef _WIN32 #define _WIN32_WINNT 0x501 #ifndef _CRT_SECURE_NO_WARNINGS @@ -741,8 +747,8 @@ void dyad_update(void) { break; } } - /* Fall through */ + FALLTHROUGH; case DYAD_STATE_CLOSING: if (select_has(&dyad_selectSet, SELECT_WRITE, stream->sockfd)) { stream_flushWriteBuffer(stream); diff --git a/src/main/pg/pg.h b/src/main/pg/pg.h index cab5724bd2..f29747c638 100644 --- a/src/main/pg/pg.h +++ b/src/main/pg/pg.h @@ -134,7 +134,7 @@ extern const uint8_t __pg_resetdata_end[]; #define PG_REGISTER_WITH_RESET_FN(_type, _name, _pgn, _version) \ extern void pgResetFn_ ## _name(_type *); \ - PG_REGISTER_I(_type, _name, _pgn, _version, .reset = {.fn = (pgResetFunc*)&pgResetFn_ ## _name }) \ + PG_REGISTER_I(_type, _name, _pgn, _version, .reset = {.fn = (pgResetFunc*)(void (*)())&pgResetFn_ ## _name }) \ /**/ #define PG_REGISTER_WITH_RESET_TEMPLATE(_type, _name, _pgn, _version) \ @@ -163,7 +163,7 @@ extern const uint8_t __pg_resetdata_end[]; #define PG_REGISTER_ARRAY_WITH_RESET_FN(_type, _size, _name, _pgn, _version) \ extern void pgResetFn_ ## _name(_type *); \ - PG_REGISTER_ARRAY_I(_type, _size, _name, _pgn, _version, .reset = {.fn = (pgResetFunc*)&pgResetFn_ ## _name}) \ + PG_REGISTER_ARRAY_I(_type, _size, _name, _pgn, _version, .reset = {.fn = (pgResetFunc*)(void (*)())&pgResetFn_ ## _name}) \ /**/ #if 0 diff --git a/src/main/rx/rx.c b/src/main/rx/rx.c index bbeab00332..122dc1b3d4 100644 --- a/src/main/rx/rx.c +++ b/src/main/rx/rx.c @@ -476,8 +476,8 @@ static uint16_t getRxfailValue(uint8_t channel) return rxConfig()->rx_min_usec; } } - /* no break */ + FALLTHROUGH; default: case RX_FAILSAFE_MODE_INVALID: case RX_FAILSAFE_MODE_HOLD: