mirror of
https://github.com/fmtlib/fmt.git
synced 2025-01-27 06:35:37 +00:00
1b8f499ee1
Problem: - gcc-10 is generating the following warning at all standards: test/format-test.cc: In member function 'virtual void UtilTest_BitCast_Test::TestBody()': test/format-test.cc:108:42: error: useless cast to type 'uint64_t' {aka 'long long unsigned int'} [-Werror=useless-cast] 108 | s = fmt::detail::bit_cast<uint32_pair>(uint64_t(~0ull)); | ^~~~~~~~~~~~~~~ - gcc-8 is generating the following warning at all standards: test/format-test.cc: In member function 'virtual void UtilTest_BitCast_Test::TestBody()': test/format-test.cc:108:56: error: useless cast to type 'uint64_t' {aka 'long long unsigned int'} [-Werror=useless-cast] s = fmt::detail::bit_cast<uint32_pair>(uint64_t(~0ull)); ^ Solution: - Cast 0 to a 64 unsigned bit int and then invert. Co-authored-by: Jonathan Gopel <jgopel@quantlab.com>