Cleanup warnings with nvhpc/21.9.

This commit is contained in:
Olli Lupton 2021-11-04 10:29:21 +01:00
parent 812733cc96
commit ec220be0c0
No known key found for this signature in database
GPG Key ID: 2886C101B2C08D0E
2 changed files with 10 additions and 7 deletions

View File

@ -279,7 +279,7 @@
// Enable minimal optimizations for more compact code in debug mode. // Enable minimal optimizations for more compact code in debug mode.
FMT_GCC_PRAGMA("GCC push_options") FMT_GCC_PRAGMA("GCC push_options")
#ifndef __OPTIMIZE__ #if !defined(__OPTIMIZE__) && !defined(__NVCOMPILER)
FMT_GCC_PRAGMA("GCC optimize(\"Og\")") FMT_GCC_PRAGMA("GCC optimize(\"Og\")")
#endif #endif

View File

@ -967,15 +967,18 @@ FMT_CONSTEXPR20 inline auto count_digits(uint64_t n) -> int {
template <int BITS, typename UInt> template <int BITS, typename UInt>
FMT_CONSTEXPR auto count_digits(UInt n) -> int { FMT_CONSTEXPR auto count_digits(UInt n) -> int {
#ifdef FMT_BUILTIN_CLZ #ifdef FMT_BUILTIN_CLZ
if (num_bits<UInt>() == 32) if (num_bits<UInt>() == 32) {
return (FMT_BUILTIN_CLZ(static_cast<uint32_t>(n) | 1) ^ 31) / BITS + 1; return (FMT_BUILTIN_CLZ(static_cast<uint32_t>(n) | 1) ^ 31) / BITS + 1;
} else
#endif #endif
{
int num_digits = 0; int num_digits = 0;
do { do {
++num_digits; ++num_digits;
} while ((n >>= BITS) != 0); } while ((n >>= BITS) != 0);
return num_digits; return num_digits;
} }
}
template <> auto count_digits<4>(detail::fallback_uintptr n) -> int; template <> auto count_digits<4>(detail::fallback_uintptr n) -> int;