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

Fix missing cstdint header in latest gcc build #512

Closed
wants to merge 1 commit into from

Conversation

zaidhaan
Copy link
Contributor

🦟 Bug fix

GCC 13.1.1 fails to compile this library:

[ 92%] Building CXX object profiler/src/CMakeFiles/gz-common5-profiler.dir/RemoteryProfilerImpl.cc.o
In file included from ./ign-common/profiler/src/RemoteryProfilerImpl.hh:26,
                 from ./ign-common/profiler/src/RemoteryProfilerImpl.cc:20:
./ign-common/profiler/src/ProfilerImpl.hh:56:59: error: ‘uint32_t’ has not been declared
   56 |       public: virtual void BeginSample(const char *_name, uint32_t *_hash) = 0;
      |                                                           ^~~~~~~~
./ign-common/profiler/src/RemoteryProfilerImpl.hh:74:51: error: ‘uint32_t’ has not been declared
   74 |       public: void BeginSample(const char *_name, uint32_t *_hash) final;
      |                                                   ^~~~~~~~
./ign-common/profiler/src/RemoteryProfilerImpl.cc:227:6: error: no declaration matches ‘void gz::common::RemoteryProfilerImpl::BeginSample(const char*, uint32_t*)’
  227 | void RemoteryProfilerImpl::BeginSample(const char *_name, uint32_t *_hash)
      |      ^~~~~~~~~~~~~~~~~~~~
./ign-common/profiler/src/RemoteryProfilerImpl.hh:74:20: note: candidate is: ‘virtual void gz::common::RemoteryProfilerImpl::BeginSample(const char*, int*)’
   74 |       public: void BeginSample(const char *_name, uint32_t *_hash) final;
      |                    ^~~~~~~~~~~
./ign-common/profiler/src/RemoteryProfilerImpl.hh:47:11: note: ‘class gz::common::RemoteryProfilerImpl’ defined here
   47 |     class RemoteryProfilerImpl final: public ProfilerImpl
      |           ^~~~~~~~~~~~~~~~~~~~
make[2]: *** [profiler/src/CMakeFiles/gz-common5-profiler.dir/build.make:104: profiler/src/CMakeFiles/gz-common5-profiler.dir/RemoteryProfilerImpl.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:3814: profiler/src/CMakeFiles/gz-common5-profiler.dir/all] Error 2
make: *** [Makefile:146: all] Error 2

It appears that <cstdint> is missing from RemoteryProfilerImpl.hh.

Summary

The missing <cstdint> is added to RemoteryProfilerImpl.hh, causing a successful compile.
Able to reproduce and fix on gcc (GCC) 13.1.1 20230429 on Arch Linux.

Checklist

  • Signed all commits for DCO
  • Added tests
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

@marcoag
Copy link
Member

marcoag commented May 22, 2023

It seems this file is the same in ign-common3 which I believe is supported till Dec 2024. Maybe the fix should target that first?

@zaidhaan
Copy link
Contributor Author

It seems this file is the same in ign-common3 which I believe is supported till Dec 2024. Maybe the fix should target that first?

Ah, that's actually true. I also faced this issue in ign-common3 but looks like I was a little too quick when doing the PR.

Should I close this one and open a new PR targeting the ign-common3 branch?

@marcoag
Copy link
Member

marcoag commented May 22, 2023

Yes, please. Let's target ign-common3 and then the fix will come here through a forward port.

@zaidhaan zaidhaan closed this May 22, 2023
@zaidhaan zaidhaan deleted the fix-missing-cstdint branch May 22, 2023 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌱 garden Ignition Garden 🎵 harmonic Gazebo Harmonic
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants