From 75affc8f555f8b757834e156abdba7331cfe71dd Mon Sep 17 00:00:00 2001 From: Nicolas Williams Date: Mon, 5 Jan 2026 19:05:23 -0600 Subject: [PATCH] cf: clang pretends to be GCC 4 --- configure.ac | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/configure.ac b/configure.ac index a38bbff84..be9f02e91 100644 --- a/configure.ac +++ b/configure.ac @@ -547,16 +547,13 @@ dnl Deal with switch fallthrough warnings AH_TOP([ #if defined(DISPATCH_FALLTHROUGH) # define HEIM_FALLTHROUGH DISPATCH_FALLTHROUGH +#elif defined(__clang__) + /* Clang sets __GNUC__ to 4 for compat, but supports fallthrough attr */ +# define HEIM_FALLTHROUGH __attribute__((fallthrough)) +#elif defined(__GNUC__) && __GNUC__ >= 7 +# define HEIM_FALLTHROUGH __attribute__((fallthrough)) #else -# if defined(__GNUC__) -# if __GNUC__ >= 7 -# define HEIM_FALLTHROUGH __attribute__((fallthrough)) -# else -# define HEIM_FALLTHROUGH do {} while (0) /* fallthrough */ -# endif -# else -# define HEIM_FALLTHROUGH do {} while (0) /* fallthrough */ -# endif +# define HEIM_FALLTHROUGH do {} while (0) /* fallthrough */ #endif ])