It seems clang does not like these attributes in c++98 mode. Signed-off-by: Rosen Penev <rosenp@xxxxxxxxx> --- include/compiler.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/include/compiler.h b/include/compiler.h index 53d9b7ec..5ad54f41 100644 --- a/include/compiler.h +++ b/include/compiler.h @@ -1,14 +1,17 @@ -#ifdef __cplusplus - #ifdef _LIBCPP_VERSION #define fallthrough _LIBCPP_FALLTHROUGH() #else +#if __cplusplus >= 201103L + #ifdef __clang__ #define fallthrough [[clang::fallthrough]] #else #define fallthrough [[gnu::fallthrough]] -#endif +#endif // __clang__ + +#else +#define fallthrough ((void)0) -#endif -#endif +#endif // __cplusplus +#endif // _LIBCPP_VERSION -- 2.25.3