Skip to content

Fix implicit narrowing in tf2 time conversion - #1834

Open
ktyang512 wants to merge 1 commit into
ros2:rollingfrom
ktyang512:fix/msvc-c4244-time-conversion-1832
Open

Fix implicit narrowing in tf2 time conversion#1834
ktyang512 wants to merge 1 commit into
ros2:rollingfrom
ktyang512:fix/msvc-c4244-time-conversion-1832

Conversation

@ktyang512

Copy link
Copy Markdown

Description

Fixes #1832.

fromTf2TimePoint() passes 64-bit chrono counts to the rclcpp::Time(int32_t, uint32_t) constructor. Add explicit fixed-width casts, matching the adjacent createHeader() implementation and preventing MSVC C4244 warnings.

Is this user-facing behavior change?

No.

Testing

  • Focused build of the actual translation unit with GCC 11.4.0 and -Wconversion -Werror (failed on the two implicit conversions before the change; passed after)
  • Focused conversion/round-trip CTest: 1/1 passed
  • ament_uncrustify: passed
  • ament_cpplint: passed
  • git diff --check: passed

Native MSVC and the full Rolling rviz_common suite were not available locally; the host ROS Humble underlay lacks ament_cmake_ros_core, so tier-1 CI remains the final platform-specific validation.

Generated-by: OpenAI Codex (GPT-5)

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>
@mergify

mergify Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@ktyang512

Copy link
Copy Markdown
Author

@Mergifyio queue

@mergify

mergify Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

queue

☑️ Command disallowed due to command restrictions in the Mergify configuration.

Details
  • sender-permission >= write

@skyegalaxy

Copy link
Copy Markdown
Member

@UseTheForce007

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.

🧑‍🌾 MSVC C4244 warnings persist in tf2_conversion_helpers.cpp

2 participants