ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
2

Can catkin_make show all warnings?

asked 2014-03-10 06:49:27 -0600

Thomas D gravatar image

Is there a way to have catkin_make print all warnings? I am using Jenkins to test the builds of packages under Ubuntu 12.04 and ROS Hydro. I would like to track all the warnings from the packages and need to have those printed out. The best solution for me would be a command line argument rather than editing existing CMakeLists.txt files to add a definition for -Wall. I've found that the first time I build packages the warnings are printed but after the first build the warnings are suppressed.

I have looked at the output of catkin_make --help and none of the --cmake-args or --make-args seem to do what I want.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2014-03-10 07:03:33 -0600

Wolf gravatar image

You can directly set cmake args if you add them to your catkin_make call. E. g. you could

catkin_make -DCMAKE_CXX_FLAGS=-Wall -DCMAKE_C_FLAGS=-Wall

But you have to be aware that you have !always! to append to the flags afterwards in your CMakeLists.txt like

set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DOTHER_STUFF=1" )

Also warnings will only be printed if your code is actually compiled. Files already compiled and not cahnged will not be compiled in a repeative call, i. e. possible warnings might not be printed. If you want to be sure all warnings in your workspace are really printed you might want to erase your build and devel subfolders of your catkin_ws before calling catkin_make...

edit flag offensive delete link more

Comments

1

Tested and verified. I put a `catkin_make clean` before actually building and it keeps warnings across multiple builds. Thanks!

Thomas D gravatar image Thomas D  ( 2014-03-10 09:42:31 -0600 )edit

And how do we disable the flags if we dont want to use them anymore (compilation might get annoyingly slow when the warnings are all)?

Pototo gravatar image Pototo  ( 2016-10-12 18:27:17 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2014-03-10 06:49:27 -0600

Seen: 2,994 times

Last updated: Mar 10 '14