Appropriate warning/error level for gcc with ROS
Ref. to this question:
http://answers.ros.org/question/13819...
what would be an appropriate warning level for building packages against ROS? Ideally all released ros packages (or at least their headers) should compile at this error level
Examples:
If I compile with -Wall -Werror I cannot compile pcl using packages because:
catkin_make -DCMAKE_CXX_FLAGS=-Wall\ -Werror -DCMAKE_C_FLAGS=-Wall\ -Werror
errors, e. g.:
/usr/include/pcl-1.7/pcl/visualization/area_picking_event.h: In member function ‘bool pcl::visualization::AreaPickingEvent::getPointsIndices(std::vector<int>&) const’:
/usr/include/pcl-1.7/pcl/visualization/area_picking_event.h:64:30: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
If I compile with -Wall -Wextra -Werror I cannot compile cv_bridge using packages because:
catkin_make -DCMAKE_CXX_FLAGS=-Wall\ -Wextra\ -Werror -DCMAKE_C_FLAGS=-Wall\ -Wextra\ -Werror
errors, e. g.:
/opt/ros/hydro/include/cv_bridge/cv_bridge.h:330:61: instantiated from here
/opt/ros/hydro/include/cv_bridge/cv_bridge.h:316:15: error: unused parameter ‘s’ [-Werror=unused-parameter]
/opt/ros/hydro/include/cv_bridge/cv_bridge.h:316:15: error: unused parameter ‘indent’ [-Werror=unused-parameter]
/opt/ros/hydro/include/cv_bridge/cv_bridge.h:316:15: error: unused parameter ‘m’ [-Werror=unused-parameter]
I am under ros hydro, ubuntu 12.04. However, I would not see this as bugs in the respective packages. The question is if there is (or should be) a policy on this or is it just that everything that compiles without errors is OK? The latter would unfortunately expand to everybody using ROS because you cannot compile own code with a higher error level if the included libs do not fullfil it....