Skip to content

Fix gcc 15.2.1 warning for discarding 'const' qualifier#545

Open
EddyGharib wants to merge 1 commit intoros2:jazzyfrom
EddyGharib:jazzy
Open

Fix gcc 15.2.1 warning for discarding 'const' qualifier#545
EddyGharib wants to merge 1 commit intoros2:jazzyfrom
EddyGharib:jazzy

Conversation

@EddyGharib
Copy link

Description

Compiling with gcc version 15.2.1 generates the following warning

external/ros2_rcutils+/src/strdup.c: In function 'rcutils_strndup':
external/ros2_rcutils+/src/strdup.c:47:14: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
   47 |   char * p = memchr(str, '\0', max_length);
      |              ^~~~~~

This PR fixes that

Fixes # (issue)

Is this user-facing behavior change?

Did you use Generative AI?

Additional Information

Signed-off-by: Eddy Gharib <eddy.gharib@idealworks.com>
@fujitatomoya
Copy link
Collaborator

fujitatomoya commented Mar 9, 2026

Pulls: #545
Gist: https://gist.githubusercontent.com/fujitatomoya/8cf86a9def1a24cedfcc2c33f0264c43/raw/9570b4b0f68b58a34e1fbb9e7c2bd63fec6db4ab/ros2.repos
BUILD args: --packages-above-and-dependencies rcutils
TEST args: --packages-above rcutils
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/18402

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

Copy link
Contributor

@ahcorde ahcorde left a comment

Choose a reason for hiding this comment

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

Do you mind to target rolling ? then we can backport this to older distros

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