From 50fa648ae095a88ffd6e95872180b7af1f0a0cfc Mon Sep 17 00:00:00 2001 From: Ali Ghaffaari Date: Mon, 11 Mar 2024 23:21:20 +0100 Subject: [PATCH] Fix nvcc warning about missing return statement (#235) --- parallel_hashmap/phmap.h | 1 + parallel_hashmap/phmap_config.h | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/parallel_hashmap/phmap.h b/parallel_hashmap/phmap.h index 103f7ae..e59b02a 100644 --- a/parallel_hashmap/phmap.h +++ b/parallel_hashmap/phmap.h @@ -210,6 +210,7 @@ uint32_t TrailingZeros(T x) { return base_internal::CountTrailingZerosNonZero64(static_cast(x)); else return base_internal::CountTrailingZerosNonZero32(static_cast(x)); + PHMAP_BUILTIN_UNREACHABLE(); } // -------------------------------------------------------------------------- diff --git a/parallel_hashmap/phmap_config.h b/parallel_hashmap/phmap_config.h index b2e8654..a871ba0 100644 --- a/parallel_hashmap/phmap_config.h +++ b/parallel_hashmap/phmap_config.h @@ -650,6 +650,15 @@ #define PHMAP_IF_CONSTEXPR(expr) if ((expr)) #endif +// ---------------------------------------------------------------------- +// builtin unreachable +// ---------------------------------------------------------------------- +#if PHMAP_HAVE_BUILTIN(__builtin_unreachable) + #define PHMAP_BUILTIN_UNREACHABLE() __builtin_unreachable() +#else + #define PHMAP_BUILTIN_UNREACHABLE() (void)0 +#endif + // ---------------------------------------------------------------------- // base/macros.h // ----------------------------------------------------------------------