diff --git a/src/util/macros.h b/src/util/macros.h index af4c8c80b60..9403d337e49 100644 --- a/src/util/macros.h +++ b/src/util/macros.h @@ -122,17 +122,23 @@ #if defined(HAVE___BUILTIN_UNREACHABLE) || __has_builtin(__builtin_unreachable) #define UNREACHABLE(str) \ do { \ - assert(!"" str); \ + (void)"" str; /* str must be a string literal */ \ + assert(!str); \ __builtin_unreachable(); \ } while (0) #elif defined (_MSC_VER) #define UNREACHABLE(str) \ do { \ - assert(!"" str); \ + (void)"" str; /* str must be a string literal */ \ + assert(!str); \ __assume(0); \ } while (0) #else -#define UNREACHABLE(str) assert(!"" str) +#define UNREACHABLE(str) \ +do { \ + (void)"" str; /* str must be a string literal */ \ + assert(!str); \ +} while (0) #endif /**