Skip to content

rclcpp_components: Fix compilation with clang (backport #3229) - #3231

Merged
ahcorde merged 1 commit into
lyricalfrom
mergify/bp/lyrical/pr-3229
Aug 21, 2026
Merged

rclcpp_components: Fix compilation with clang (backport #3229)#3231
ahcorde merged 1 commit into
lyricalfrom
mergify/bp/lyrical/pr-3229

Conversation

@mergify

@mergify mergify Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Description

This fixes the following error reported by clang:

/ros/rclcpp/rclcpp_components/src/component_container.cpp:204:50: error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security]
  204 |   RCUTILS_LOG_DEBUG_NAMED("component_container", debug_msg.c_str());
      |                                                  ^~~~~~~~~~~~~~~~~
/nix/store/2xvm1s7bkzj40vswqm9ihlfmq7bxb291-ros-env/include/rcutils/rcutils/logging_macros.h:352:55: note: expanded from macro 'RCUTILS_LOG_DEBUG_NAMED'
  352 |   RCUTILS_LOG_NAMED(RCUTILS_LOG_SEVERITY_DEBUG, name, __VA_ARGS__)
      |                                                       ^~~~~~~~~~~
/nix/store/2xvm1s7bkzj40vswqm9ihlfmq7bxb291-ros-env/include/rcutils/rcutils/logging_macros.h:56:73: note: expanded from macro 'RCUTILS_LOG_NAMED'
   56 |       rcutils_log_internal(&__rcutils_logging_location, severity, name, __VA_ARGS__); \
      |                                                                         ^~~~~~~~~~~
/home/wsh/src/ros/rclcpp/rclcpp_components/src/component_container.cpp:204:50: note: treat the string as an argument to avoid this
  204 |   RCUTILS_LOG_DEBUG_NAMED("component_container", debug_msg.c_str());
      |                                                  ^
      |                                                  "%s",
/nix/store/2xvm1s7bkzj40vswqm9ihlfmq7bxb291-ros-env/include/rcutils/rcutils/logging_macros.h:352:55: note: expanded from macro 'RCUTILS_LOG_DEBUG_NAMED'
  352 |   RCUTILS_LOG_NAMED(RCUTILS_LOG_SEVERITY_DEBUG, name, __VA_ARGS__)
      |                                                       ^
/nix/store/2xvm1s7bkzj40vswqm9ihlfmq7bxb291-ros-env/include/rcutils/rcutils/logging_macros.h:56:73: note: expanded from macro 'RCUTILS_LOG_NAMED'
   56 |       rcutils_log_internal(&__rcutils_logging_location, severity, name, __VA_ARGS__); \
      |                                                                         ^

Is this user-facing behavior change?

No

Did you use Generative AI?

No


This is an automatic backport of pull request #3229 done by [Mergify](https://mergify.com).

This fixes the following error reported by clang:

    /ros/rclcpp/rclcpp_components/src/component_container.cpp:204:50: error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security]
      204 |   RCUTILS_LOG_DEBUG_NAMED("component_container", debug_msg.c_str());
          |                                                  ^~~~~~~~~~~~~~~~~
    /nix/store/2xvm1s7bkzj40vswqm9ihlfmq7bxb291-ros-env/include/rcutils/rcutils/logging_macros.h:352:55: note: expanded from macro 'RCUTILS_LOG_DEBUG_NAMED'
      352 |   RCUTILS_LOG_NAMED(RCUTILS_LOG_SEVERITY_DEBUG, name, __VA_ARGS__)
          |                                                       ^~~~~~~~~~~
    /nix/store/2xvm1s7bkzj40vswqm9ihlfmq7bxb291-ros-env/include/rcutils/rcutils/logging_macros.h:56:73: note: expanded from macro 'RCUTILS_LOG_NAMED'
       56 |       rcutils_log_internal(&__rcutils_logging_location, severity, name, __VA_ARGS__); \
          |                                                                         ^~~~~~~~~~~
    /home/wsh/src/ros/rclcpp/rclcpp_components/src/component_container.cpp:204:50: note: treat the string as an argument to avoid this
      204 |   RCUTILS_LOG_DEBUG_NAMED("component_container", debug_msg.c_str());
          |                                                  ^
          |                                                  "%s",
    /nix/store/2xvm1s7bkzj40vswqm9ihlfmq7bxb291-ros-env/include/rcutils/rcutils/logging_macros.h:352:55: note: expanded from macro 'RCUTILS_LOG_DEBUG_NAMED'
      352 |   RCUTILS_LOG_NAMED(RCUTILS_LOG_SEVERITY_DEBUG, name, __VA_ARGS__)
          |                                                       ^
    /nix/store/2xvm1s7bkzj40vswqm9ihlfmq7bxb291-ros-env/include/rcutils/rcutils/logging_macros.h:56:73: note: expanded from macro 'RCUTILS_LOG_NAMED'
       56 |       rcutils_log_internal(&__rcutils_logging_location, severity, name, __VA_ARGS__); \
          |                                                                         ^

Signed-off-by: Michal Sojka <michal.sojka@cvut.cz>
(cherry picked from commit 329abd8)
@ahcorde

ahcorde commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Pulls: #3231
Gist: https://gist.githubusercontent.com/ahcorde/3f969bbba466ef68638727e1157de508/raw/df946b3257890617d29c4efff0a921c8797577ca/ros2.repos
BUILD args: --packages-up-to rclcpp
TEST args: --packages-select rclcpp
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/20131

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

@mergify

mergify Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

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

  • Queue this pull request

@ahcorde
ahcorde merged commit 1f8ba63 into lyrical Aug 21, 2026
3 checks passed
@ahcorde
ahcorde deleted the mergify/bp/lyrical/pr-3229 branch August 21, 2026 07:50
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.

2 participants