Fix implicit narrowing in tf2 time conversion - #1834
Open
ktyang512 wants to merge 1 commit into
Open
Conversation
Use explicit fixed-width casts when constructing rclcpp::Time, matching createHeader and silencing MSVC C4244 warnings. Generated-by: OpenAI Codex (GPT-5) Signed-off-by: ktyang512 <ktyang512@gmail.com>
Contributor
|
Tick the box to add this pull request to the merge queue (same as
|
Author
|
@Mergifyio queue |
Contributor
☑️ Command disallowed due to command restrictions in the Mergify configuration.Details
|
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #1832.
fromTf2TimePoint()passes 64-bit chrono counts to therclcpp::Time(int32_t, uint32_t)constructor. Add explicit fixed-width casts, matching the adjacentcreateHeader()implementation and preventing MSVC C4244 warnings.Is this user-facing behavior change?
No.
Testing
-Wconversion -Werror(failed on the two implicit conversions before the change; passed after)ament_uncrustify: passedament_cpplint: passedgit diff --check: passedNative MSVC and the full Rolling
rviz_commonsuite were not available locally; the host ROS Humble underlay lacksament_cmake_ros_core, so tier-1 CI remains the final platform-specific validation.Generated-by: OpenAI Codex (GPT-5)