From c79942d2efe5a199e10628d7aebeca57566a41e2 Mon Sep 17 00:00:00 2001 From: John Date: Fri, 5 Nov 2021 11:27:45 +0100 Subject: [PATCH] fix compiler warning with newer versions (fixes #448) --- src/ebusd/bushandler.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/ebusd/bushandler.cpp b/src/ebusd/bushandler.cpp index e2410981..f2f69755 100644 --- a/src/ebusd/bushandler.cpp +++ b/src/ebusd/bushandler.cpp @@ -425,6 +425,14 @@ void BusHandler::run() { } while (isRunning()); } +#ifndef FALLTHROUGH +#if defined(__GNUC__) && __GNUC__ >= 7 +#define FALLTHROUGH [[fallthrough]]; +#else +#define FALLTHROUGH +#endif +#endif + result_t BusHandler::handleSymbol() { unsigned int timeout = SYN_TIMEOUT; symbol_t sendSymbol = ESC; @@ -438,6 +446,7 @@ result_t BusHandler::handleSymbol() { case bs_skip: timeout = SYN_TIMEOUT; + FALLTHROUGH case bs_ready: if (m_currentRequest != nullptr) { setState(bs_ready, RESULT_ERR_TIMEOUT); // just to be sure an old BusRequest is cleaned up