fix compiler warning with newer versions (fixes #448)

This commit is contained in:
John
2021-11-05 11:27:45 +01:00
parent c8a41f0999
commit c79942d2ef
+9
View File
@@ -425,6 +425,14 @@ void BusHandler::run() {
} while (isRunning()); } while (isRunning());
} }
#ifndef FALLTHROUGH
#if defined(__GNUC__) && __GNUC__ >= 7
#define FALLTHROUGH [[fallthrough]];
#else
#define FALLTHROUGH
#endif
#endif
result_t BusHandler::handleSymbol() { result_t BusHandler::handleSymbol() {
unsigned int timeout = SYN_TIMEOUT; unsigned int timeout = SYN_TIMEOUT;
symbol_t sendSymbol = ESC; symbol_t sendSymbol = ESC;
@@ -438,6 +446,7 @@ result_t BusHandler::handleSymbol() {
case bs_skip: case bs_skip:
timeout = SYN_TIMEOUT; timeout = SYN_TIMEOUT;
FALLTHROUGH
case bs_ready: case bs_ready:
if (m_currentRequest != nullptr) { if (m_currentRequest != nullptr) {
setState(bs_ready, RESULT_ERR_TIMEOUT); // just to be sure an old BusRequest is cleaned up setState(bs_ready, RESULT_ERR_TIMEOUT); // just to be sure an old BusRequest is cleaned up