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

cppcheck uses c++17 #404

Merged
merged 2 commits into from
Feb 1, 2024
Merged

cppcheck uses c++17 #404

merged 2 commits into from
Feb 1, 2024

Conversation

sdhar04
Copy link
Contributor

@sdhar04 sdhar04 commented Jan 22, 2024

Closes #378

Summary

Changed Line 20 of /cmake/GzCodeCheck.cmake to update a cppcheck parameter from c++14 to c++17

Test it

I don't know exactly how to make tests for this, but I'm guessing you could:
Run cmake -DCMAKE_CXX_CPPCHECK:FILEPATH=cppcheck . inside a package
Or build and make workspaces and packages where Gazebo is used

@github-actions github-actions bot added 🌱 garden Ignition Garden 🎵 harmonic Gazebo Harmonic labels Jan 22, 2024
@azeey
Copy link
Contributor

azeey commented Jan 22, 2024

@sdhar04 Thanks for your contribution! Would you be able to check if each of the Gazebo libraries pass cppcheck before we merge this PR? Also, could you signoff on your commit so the DCO check can pass?

Signed-off-by: sdhar04 <sammit.dhar.2004@gmail.com>
@sdhar04
Copy link
Contributor Author

sdhar04 commented Jan 22, 2024

Hello @azeey ! Could you give me some pointers as to how I can check if a library passes cppcheck?

@scpeters
Copy link
Member

Hello @azeey ! Could you give me some pointers as to how I can check if a library passes cppcheck?

If you are able to build Garden or Harmonic from source in a colcon workspace (using these instructions), using this branch of gz-cmake3, then you can run make codecheck from each package subfolder of the workspace build folder (build/gz-math7, build/gz-common5, etc), I think that would do it.

@sdhar04
Copy link
Contributor Author

sdhar04 commented Jan 22, 2024

I am on Ubuntu 20.04 and tried to build Garden from the tutorial. My plan was to completely install from source and then replicate the changes I had made in this PR. But colcon build --cmake-args -DBUILD_TESTING=OFF --merge-install is giving me an error while trying to build gz-msgs9, specifically plugins being killed by signal 11 (I haven't made the changes yet).
Is there a workaround?

@scpeters
Copy link
Member

I am on Ubuntu 20.04 and tried to build Garden from the tutorial. My plan was to completely install from source and then replicate the changes I had made in this PR. But colcon build --cmake-args -DBUILD_TESTING=OFF --merge-install is giving me an error while trying to build gz-msgs9, specifically plugins being killed by signal 11 (I haven't made the changes yet). Is there a workaround?

it sounds like you're having trouble building from source. Here are the garden build from source instructions. Can you post a question on Robotics Stack Exchange with details on your build error and then link it here so we can follow up?

@sdhar04
Copy link
Contributor Author

sdhar04 commented Jan 23, 2024

Here is the question I've asked.
It seems protoc-gen-ignmsgs is causing segmentation faults.

@sdhar04
Copy link
Contributor Author

sdhar04 commented Jan 23, 2024

Here is the question I've asked. It seems protoc-gen-ignmsgs is causing segmentation faults.

Shall I raise an issue regarding this?

@azeey
Copy link
Contributor

azeey commented Jan 23, 2024

Here is the question I've asked. It seems protoc-gen-ignmsgs is causing segmentation faults.

Shall I raise an issue regarding this?

Did you have a chance to try my suggestion?

@sdhar04
Copy link
Contributor Author

sdhar04 commented Jan 23, 2024

Here is the question I've asked. It seems protoc-gen-ignmsgs is causing segmentation faults.

Shall I raise an issue regarding this?

Did you have a chance to try my suggestion?

I did, and it's giving me the same errors

@sdhar04
Copy link
Contributor Author

sdhar04 commented Jan 31, 2024

Hello @azeey ! Could you give me some pointers as to how I can check if a library passes cppcheck?

If you are able to build Garden or Harmonic from source in a colcon workspace (using these instructions), using this branch of gz-cmake3, then you can run make codecheck from each package subfolder of the workspace build folder (build/gz-math7, build/gz-common5, etc), I think that would do it.

I have built Gazebo from source on a cleaner Ubuntu system, and run make codecheck successfully from each package. The targets cpplint, cppcheck, and codecheck have all been built for each package.

@azeey
Copy link
Contributor

azeey commented Feb 1, 2024

Hello @azeey ! Could you give me some pointers as to how I can check if a library passes cppcheck?

If you are able to build Garden or Harmonic from source in a colcon workspace (using these instructions), using this branch of gz-cmake3, then you can run make codecheck from each package subfolder of the workspace build folder (build/gz-math7, build/gz-common5, etc), I think that would do it.

I have built Gazebo from source on a cleaner Ubuntu system, and run make codecheck successfully from each package. The targets cpplint, cppcheck, and codecheck have all been built for each package.

Awesome, thanks!

@azeey azeey enabled auto-merge (squash) February 1, 2024 01:58
@azeey azeey disabled auto-merge February 1, 2024 05:51
@azeey azeey merged commit ebf5175 into gazebosim:gz-cmake3 Feb 1, 2024
8 checks passed
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.

cppcheck needs to be updated to use c++17
3 participants