diff --git a/wolfssl/wolfcrypt/types.h b/wolfssl/wolfcrypt/types.h index f7bcd837c..7a1a57d77 100755 --- a/wolfssl/wolfcrypt/types.h +++ b/wolfssl/wolfcrypt/types.h @@ -162,13 +162,14 @@ #endif /* GCC 7 has new switch() fall-through detection */ - #ifndef FALL_THROUGH - #if defined(__GNUC__) - #define FALL_THROUGH __attribute__ ((fallthrough)) - #else - #define FALL_THROUGH + #if defined(__GNUC__) + #if ((__GNUC__ > 7) || ((__GNUC__ == 7) && (__GNUC_MINOR__ >= 1))) + #define FALL_THROUGH __attribute__ ((fallthrough)); #endif #endif + #ifndef FALL_THROUGH + #define FALL_THROUGH + #endif /* Micrium will use Visual Studio for compilation but not the Win32 API */ #if defined(_WIN32) && !defined(MICRIUM) && !defined(FREERTOS) && \