actionlib icon indicating copy to clipboard operation
actionlib copied to clipboard

actionlib fails compilation with stricter GCC options

Open sytelus opened this issue 9 years ago • 3 comments

It looks like some of the actionlib uses unnecessary ";" which GCC correctly points out with stricter options. For example,

/opt/ros/indigo/include/actionlib/action_definition.h:58:2: error: extra ‘;’ [-Werror=pedantic]
/opt/ros/indigo/include/actionlib/destruction_guard.h:126:2: error: extra ‘;’ [-Werror=pedantic]
/opt/ros/indigo/include/actionlib_msgs/GoalID.h:177:36: error: extra ‘;’ [-Werror=pedantic]
/opt/ros/indigo/include/std_msgs/Header.h:188:36: error: extra ‘;’ [-Werror=pedantic]
/opt/ros/indigo/include/actionlib_msgs/GoalStatus.h:240:36: error: extra ‘;’ [-Werror=pedantic]

To reproduce these errors turn on checks in GCC using following line in CMakeLists.txt:

set(CMAKE_CXX_FLAGS "-std=c++11 -Wall -Wextra -Wstrict-aliasing -pedantic -fmax-errors=5 -Werror -Wunreachable-code ${CMAKE_CXX_FLAGS}")

sytelus avatar May 21 '16 06:05 sytelus

Indeed a lot of semicolons in the codebase are not necessary. Feel free to submit a pull request to address these in actionlib or any other package you want to compile with the -pedantic flag. Thanks for pointing it out.

mikaelarguedas avatar May 24 '16 00:05 mikaelarguedas

marking this with milestone untargeted given that we don't target these flags on ROS1 packages. We will still happily merge code cleaning pull requests

mikaelarguedas avatar Aug 25 '16 20:08 mikaelarguedas

Addressed in https://github.com/ros/actionlib/pull/135.

remod avatar Apr 30 '19 13:04 remod