Skip to content

Make format string agree with argument type.#24

Merged
clalancette merged 2 commits intomasterfrom
fix-format-warning
May 1, 2019
Merged

Make format string agree with argument type.#24
clalancette merged 2 commits intomasterfrom
fix-format-warning

Conversation

@nuclearsandwich
Copy link
Copy Markdown
Member

This resolves warnings which popped up as a result of
ros2/rcutils#154.

This resolves warnings which popped up as a result of
ros2/rcutils#154.
@nuclearsandwich nuclearsandwich added the in progress Actively being worked on (Kanban column) label May 1, 2019
"%g ) than the lower bound you provided ("
"%g) (will print only once)",
"%ld ) than the lower bound you provided ("
"%ld) (will print only once)",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

PRId64 looks like the right thing for int64_t.

RCUTILS_LOG_WARN_ONCE("Messages of type %d arrived closer ("
"%g ) than the lower bound you provided ("
"%g) (will print only once)",
"%ld ) than the lower bound you provided ("
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.

From what I can tell, this is printing out a rclcpp::Time.nanoseconds(), which is an int64_t. While the above most likely works on 64-bit arches, the truly portable way to do this is with %PRId64 (that way it won't warn on 32-bit either). I'm going to change these two to use that instead.

Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
@clalancette clalancette added in review Waiting for review (Kanban column) and removed in progress Actively being worked on (Kanban column) labels May 1, 2019
@clalancette
Copy link
Copy Markdown
Contributor

CI is green:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@clalancette clalancette merged commit db23931 into master May 1, 2019
@clalancette clalancette deleted the fix-format-warning branch May 1, 2019 18:21
@clalancette clalancette removed the in review Waiting for review (Kanban column) label May 1, 2019
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.

3 participants