Skip to content

Hotfix/Compiler Warnings MuJocO#989

Merged
juan-g-bonilla merged 4 commits into
developfrom
hotfix/compiler-warnings-mujoco
Apr 21, 2025
Merged

Hotfix/Compiler Warnings MuJocO#989
juan-g-bonilla merged 4 commits into
developfrom
hotfix/compiler-warnings-mujoco

Conversation

@juan-g-bonilla

Copy link
Copy Markdown
Contributor
  • Tickets addressed: Hotfix
  • Review: By commit
  • Merge strategy: Merge (no squash)

Description

Some mujocoDynamics code was raising compiler warnings. These commits address these.

One of the warnings was due to a missing override keyword.

The other warning was raised because some functions were reaching the control flow end without returning the expected value. However, this is because a logAndThrow was being called, which throws an error and thus interrupts normal control flow. By letting the compiler know that this function is [[noreturn]], it no longer cares about the return on that path of the control flow.

Verification

I'll check the MacOS build logs for compiler warnings (I'm tagging this PR dont merge until I've done this manual check).

@juan-g-bonilla juan-g-bonilla added dont merge Waiting on other changes before merging build Build system or compilation enhancement labels Apr 20, 2025
@juan-g-bonilla juan-g-bonilla self-assigned this Apr 20, 2025
@juan-g-bonilla juan-g-bonilla requested a review from a team as a code owner April 20, 2025 22:41
@schaubh

schaubh commented Apr 20, 2025

Copy link
Copy Markdown
Contributor

Just tried building on macOS Terminal using cmake and I didn't see the compiler warnings I saw before.

Compiled in Xcode and I get this compiler warning:

ld: warning: ignoring duplicate libraries: '/Users/hp/Repos/basilisk/dist3/Basilisk/libArchitectureUtilities.a', '/Users/hp/Repos/basilisk/dist3/Basilisk/libcMsgCInterface.a'

and the attached warning about an implicit conversion in MJSite.cpp.
Screenshot 2025-04-20 at 16 53 22

Implicit conversion raises warnings
@juan-g-bonilla

Copy link
Copy Markdown
Contributor Author

Just tried building on macOS Terminal using cmake and I didn't see the compiler warnings I saw before.

Compiled in Xcode and I get this compiler warning:

ld: warning: ignoring duplicate libraries: '/Users/hp/Repos/basilisk/dist3/Basilisk/libArchitectureUtilities.a', '/Users/hp/Repos/basilisk/dist3/Basilisk/libcMsgCInterface.a'

and the attached warning about an implicit conversion in MJSite.cpp. Screenshot 2025-04-20 at 16 53 22

Just pushed a commit for the implicit conversion warning. Not sure about the double linkage error, ill investigate further.

@juan-g-bonilla

Copy link
Copy Markdown
Contributor Author

Just tried building on macOS Terminal using cmake and I didn't see the compiler warnings I saw before.

Compiled in Xcode and I get this compiler warning:

ld: warning: ignoring duplicate libraries: '/Users/hp/Repos/basilisk/dist3/Basilisk/libArchitectureUtilities.a', '/Users/hp/Repos/basilisk/dist3/Basilisk/libcMsgCInterface.a'

and the attached warning about an implicit conversion in MJSite.cpp. Screenshot 2025-04-20 at 16 53 22

I think I also fixed the double linkage issue. I don't see it in my terminal anymore.

@schaubh

schaubh commented Apr 20, 2025

Copy link
Copy Markdown
Contributor

Cool, thanks for addressing these warnings. Yesterday I was not able to build BSK+mujoco in Xcode, after your commits earlier today it works again. This gives us a clean code base to work with 🤠

@juan-g-bonilla juan-g-bonilla removed the dont merge Waiting on other changes before merging label Apr 21, 2025
@juan-g-bonilla

Copy link
Copy Markdown
Contributor Author

@schaubh ready for review. I don't see any compiler warnings on the Macos build.

@schaubh schaubh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to go.

@juan-g-bonilla juan-g-bonilla merged commit 72cd8a5 into develop Apr 21, 2025
@juan-g-bonilla juan-g-bonilla deleted the hotfix/compiler-warnings-mujoco branch April 21, 2025 01:10
@github-project-automation github-project-automation Bot moved this to ✅ Done in Basilisk Apr 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Build system or compilation enhancement

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants