Skip to content

Suppress Wredundant-decls warnings - #59

Merged
henningkayser merged 1 commit into
moveit:ros2from
RoboticsYY:ros2
Nov 11, 2019
Merged

Suppress Wredundant-decls warnings#59
henningkayser merged 1 commit into
moveit:ros2from
RoboticsYY:ros2

Conversation

@RoboticsYY

Copy link
Copy Markdown

This PR intends to suppress Wredundant-decls warnings.

@henningkayser
henningkayser merged commit c4efdd7 into moveit:ros2 Nov 11, 2019
Comment thread CMakeLists.txt
# Disable Wredundant-decls warnings since rosidl generates redundant function declarations
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic -Wno-redundant-decls")

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.

We should use add_compile_options, especially in modern ROS2 projects.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Filed a new PR #60 to use add_compile_options. Seems add_compile_options can not influence the targets generated from rosidl (see here), so still use set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-redundant-decls") to suppress this warning.

Comment thread CMakeLists.txt
set(CMAKE_CXX_STANDARD 14)
endif()

# Disable Wredundant-decls warnings since rosidl generates redundant function declarations

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.

Is there a corresponding bug report at rosidl?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Filed up a bug issue at rosidl.

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