Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing cstdint includes to avoid compiler errors because of unknown symbols uint32_t #2708

Closed

Conversation

0xFEEDC0DE64
Copy link

@0xFEEDC0DE64 0xFEEDC0DE64 commented Jun 26, 2023

I get a lot of compiler errors with a Catch2 project as uintXX_t is used everywhere but the required source file is not included. I fixed the few files that came up during my compilation process (under archlinux).

I guess in older versions of gcc and dependencies there was cstdint included somewhere else and only because of that Catch2 compiled so far.

One of my failed compilation processes looked like this:

FAILED: components/catch2-build/src/CMakeFiles/Catch2.dir/catch2/internal/catch_enum_values_registry.cpp.o 
/usr/lib/ccache/bin/g++  -I<build-folder>/components/catch2-src/src/catch2/.. -I<build-folder>/generated-includes -DQT_QML_DEBUG -g -std=gnu++23 -ffile-prefix-map=<build-folder>/components/catch2-src=. -MD -MT components/catch2-build/src/CMakeFiles/Catch2.dir/catch2/internal/catch_enum_values_registry.cpp.o -MF components/catch2-build/src/CMakeFiles/Catch2.dir/catch2/internal/catch_enum_values_registry.cpp.o.d -o components/catch2-build/src/CMakeFiles/Catch2.dir/catch2/internal/catch_enum_values_registry.cpp.o -c <build-folder>/components/catch2-src/src/catch2/internal/catch_enum_values_registry.cpp
In file included from <build-folder>/components/catch2-src/src/catch2/internal/catch_enum_values_registry.cpp:9:
<build-folder>/components/catch2-src/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
<build-folder>/components/catch2-src/src/catch2/../catch2/internal/catch_string_manip.hpp:51:42: error: expected ‘)’ before ‘count’
   51 |         constexpr pluralise(std::uint64_t count, StringRef label):
      |                            ~             ^~~~~~
      |                                          )
[49/132 18.6/sec] Building CXX object components/catch2-build/src/CMakeFiles/Catch2.dir/catch2/internal/catch_debug_console.cpp.o
[50/132 18.9/sec] Building CXX object components/catch2-build/src/CMakeFiles/Catch2.dir/catch2/internal/catch_case_insensitive_comparisons.cpp.o
FAILED: components/catch2-build/src/CMakeFiles/Catch2.dir/catch2/internal/catch_case_insensitive_comparisons.cpp.o 
/usr/lib/ccache/bin/g++  -I<build-folder>/components/catch2-src/src/catch2/.. -I<build-folder>/generated-includes -DQT_QML_DEBUG -g -std=gnu++23 -ffile-prefix-map=<build-folder>/components/catch2-src=. -MD -MT components/catch2-build/src/CMakeFiles/Catch2.dir/catch2/internal/catch_case_insensitive_comparisons.cpp.o -MF components/catch2-build/src/CMakeFiles/Catch2.dir/catch2/internal/catch_case_insensitive_comparisons.cpp.o.d -o components/catch2-build/src/CMakeFiles/Catch2.dir/catch2/internal/catch_case_insensitive_comparisons.cpp.o -c <build-folder>/components/catch2-src/src/catch2/internal/catch_case_insensitive_comparisons.cpp
In file included from <build-folder>/components/catch2-src/src/catch2/internal/catch_case_insensitive_comparisons.cpp:10:
<build-folder>/components/catch2-src/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
<build-folder>/components/catch2-src/src/catch2/../catch2/internal/catch_string_manip.hpp:51:42: error: expected ‘)’ before ‘count’
   51 |         constexpr pluralise(std::uint64_t count, StringRef label):
      |                            ~             ^~~~~~
      |                                          )
[51/132 18.5/sec] Building CXX object components/catch2-build/src/CMakeFiles/Catch2.dir/catch2/internal/catch_exception_translator_registry.cpp.o
[52/132 18.8/sec] Building CXX object components/cpputils-build/CMakeFiles/cpputils.dir/src/color_utils.cpp.o
[53/132 19.2/sec] Building CXX object components/catch2-build/src/CMakeFiles/Catch2.dir/catch2/internal/catch_enforce.cpp.o
[54/132 17.8/sec] Building CXX object components/catch2-build/src/CMakeFiles/Catch2.dir/catch2/internal/catch_istream.cpp.o
[55/132 14.9/sec] Building CXX object components/catch2-build/src/CMakeFiles/Catch2.dir/catch2/internal/catch_clara.cpp.o
FAILED: components/catch2-build/src/CMakeFiles/Catch2.dir/catch2/internal/catch_clara.cpp.o 
/usr/lib/ccache/bin/g++  -I<build-folder>/components/catch2-src/src/catch2/.. -I<build-folder>/generated-includes -DQT_QML_DEBUG -g -std=gnu++23 -ffile-prefix-map=<build-folder>/components/catch2-src=. -MD -MT components/catch2-build/src/CMakeFiles/Catch2.dir/catch2/internal/catch_clara.cpp.o -MF components/catch2-build/src/CMakeFiles/Catch2.dir/catch2/internal/catch_clara.cpp.o.d -o components/catch2-build/src/CMakeFiles/Catch2.dir/catch2/internal/catch_clara.cpp.o -c <build-folder>/components/catch2-src/src/catch2/internal/catch_clara.cpp
In file included from <build-folder>/components/catch2-src/src/catch2/internal/catch_clara.cpp:12:
<build-folder>/components/catch2-src/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
<build-folder>/components/catch2-src/src/catch2/../catch2/internal/catch_string_manip.hpp:51:42: error: expected ‘)’ before ‘count’
   51 |         constexpr pluralise(std::uint64_t count, StringRef label):
      |                            ~             ^~~~~~
      |                                          )
[56/132 10.8/sec] Building CXX object components/catch2-build/src/CMakeFiles/Catch2.dir/catch2/internal/catch_fatal_condition_handler.cpp.o
[57/132 10.5/sec] Building CXX object components/catch2-build/src/CMakeFiles/Catch2.dir/catch2/interfaces/catch_interfaces_reporter.cpp.o
[58/132 9.3/sec] Building CXX object components/catch2-build/src/CMakeFiles/Catch2.dir/catch2/matchers/catch_matchers_quantifiers.cpp.o
[59/132 8.9/sec] Building CXX object components/catch2-build/src/CMakeFiles/Catch2.dir/catch2/internal/catch_list.cpp.o
[60/132 8.9/sec] Building CXX object components/catch2-build/src/CMakeFiles/Catch2.dir/catch2/matchers/catch_matchers_floating_point.cpp.o
[61/132 5.6/sec] Building CXX object components/catch2-build/src/CMakeFiles/Catch2.dir/catch2/matchers/catch_matchers_string.cpp.o

Description

GitHub Issues

@horenmar
Copy link
Member

horenmar commented Jul 4, 2023

I started reviewing the changes and wondered why the diff for catch_test_case_info.hpp doesn't make sense; in current devel, it already includes <cstdint>. Then I noticed that your branch is more than 200 commits behind devel -> could you update either to latest release, or to current devel and check whether the issue still reproduces?

@horenmar
Copy link
Member

Feel free to reopen the PR if you update your checkout and it doesn't fix the issue, but I am going to close this for now.

@horenmar horenmar closed this Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants