Skip to content

Unused variable warning when compiling in RelWithDebInfo #15

Closed

Description

@gerkey

The problem is that the variable is only referenced inside an assert(), which is presumably being compiled out under RelWithDebInfo.

Building C object CMakeFiles/rcl__rmw_opensplice_cpp.dir/src/rcl/timer.c.o
/home/gerkey/ros2_ws/src/ros2/rcl/rcl/src/rcl/wait.c: In function ‘__wait_set_clean_up’:
/home/gerkey/ros2_ws/src/ros2/rcl/rcl/src/rcl/wait.c:66:13: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]
   rcl_ret_t ret;
             ^
/home/gerkey/ros2_ws/src/ros2/rcl/rcl/src/rcl/wait.c: In function ‘rcl_wait’:
/home/gerkey/ros2_ws/src/ros2/rcl/rcl/src/rcl/wait.c:431:15: warning: variable ‘rcl_ret’ set but not used [-Wunused-but-set-variable]
     rcl_ret_t rcl_ret;
               ^

Activity

  1. wjwwood commented on Jan 5, 2016

    @wjwwood
    Member

    I'd just add a (void)ret; after each of those lines.

  2. wjwwood commented on Jan 5, 2016

    @wjwwood
    Member

    I'm looking into a pr for this.

  3. dirk-thomas commented on Feb 5, 2016

    @dirk-thomas
    Member

    Can this be closed?

  4. gerkey commented on Feb 17, 2016

    @gerkey
    MemberAuthor

    Confirmed fixed when building RelWithDebInfo on Linux.

  5. added a commit that references this issue on Jan 2, 2020
  6. added a commit that references this issue on Mar 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions