davidstone / bounded-integer

C++ library aiming to replace all built-in integers
Boost Software License 1.0
88 stars 3 forks source link

std::uint64_t is removed in GCC 13.1+ #5

Closed worthless443 closed 1 year ago

worthless443 commented 1 year ago

Because of using the latest GCC 13.1.1, I've come across the include incompatibility that std::uint64_t and beyond is no longer supported by GCC. Can we do anything about it?

[  0%] Building CXX object dependencies/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_clara.cpp.o
In file included from /home/aissy/c_cpp/bounded_int/dependencies/Catch2/src/catch2/internal/catch_clara.cpp:12:
/home/aissy/c_cpp/bounded_int/dependencies/Catch2/src/catch2/../catch2/internal/catch_string_manip.hpp:47:14: error: ‘uint64_t’ in namespace ‘std’ does not name a type; did you mean ‘wint_t’?
   47 |         std::uint64_t m_count;
      |              ^~~~~~~~
      |              wint_t
/home/aissy/c_cpp/bounded_int/dependencies/Catch2/src/catch2/../catch2/internal/catch_string_manip.hpp:51:42: error: expected ‘)’ before ‘count’
   51 |         constexpr pluralise(std::uint64_t count, StringRef label):
      |                            ~             ^~~~~~
      |                                          )
make[2]: *** [dependencies/Catch2/src/CMakeFiles/Catch2.dir/build.make:328: dependencies/Catch2/src/CMakeFiles/Catch2.dir/catch2/internal/catch_clara.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:423: dependencies/Catch2/src/CMakeFiles/Catch2.dir/all] Error 2
make: *** [Makefile:146: all] Error 2

see compiler explorer for this simple example.

davidstone commented 1 year ago

In the example godbolt link, the issue is that you need to #include <cstdint>. I'm not sure what the exact issue is that is causing that to show up in Catch2, my guess is using an old version of clang? I've never run into issues building Catch2. Unfortunately, clang 16 has too many modules bugs, so the latest version of bounded can be compiled only with clang trunk. Regardless, I just updated the version of Catch2 that I depend on, so maybe that will fix it?

davidstone commented 1 year ago

See https://godbolt.org/z/x3nsMGaon for gcc 13.1.1 working with std::uint64_t.