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

Fixed incorrect usage of fmt, causing compile errors #127

Merged
merged 1 commit into from
Jul 17, 2023

Conversation

sprenger120
Copy link
Contributor

Just found the library and I really like it. It saves so much time; thank you for your work. There is just a tiny error in the code generator, causing the following error

error: temporary of non-literal type ‘std::__cxx11::basic_string<char>’ in a constant expression
  256 |           throw rclcpp::exceptions::InvalidParameterValueException(fmt::format("Invalid value set during initialization for parameter 'led_strip.block_length': " + validation_result.error()));

The fix is easy, replace the "+ validation_result" with ", validation_result" and add a "{}" for placeholding. That is all this PR does

Copy link

@sjahr sjahr left a comment

Choose a reason for hiding this comment

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

I don't have issues building this package without this change but building it with this works too 👍 @pac48 Can you take a look at this?

@sprenger120
Copy link
Contributor Author

@sjahr Did you try forcing C++20? I forgot to mention that

@tylerjw
Copy link
Contributor

tylerjw commented Jul 17, 2023

Thank you for this fix! I'm running CI to ensure it doesn't break anything we already tested for, but the change looks good. I will add an issue to add a test to force C++20 in one of the CI jobs so we can catch this in the future. I don't want to make it hard for people to use C++20 by accident.

@tylerjw tylerjw mentioned this pull request Jul 17, 2023
@tylerjw tylerjw merged commit 0f62754 into PickNikRobotics:main Jul 17, 2023
5 checks passed
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.

None yet

3 participants