Skip to content

Drop SYSTEM option to avoid compilation errors with modern compilers#47

Open
lepalom wants to merge 1 commit intopal-robotics:kinetic-develfrom
lepalom:kinetic-devel
Open

Drop SYSTEM option to avoid compilation errors with modern compilers#47
lepalom wants to merge 1 commit intopal-robotics:kinetic-develfrom
lepalom:kinetic-devel

Conversation

@lepalom
Copy link
Copy Markdown

@lepalom lepalom commented Sep 18, 2019

This commit fix compilation errors with gcc-8 in a Debian Buster box.

In file included from /usr/include/c++/8/ext/string_conversions.h:41,
from /usr/include/c++/8/bits/basic_string.h:6400,
from /usr/include/c++/8/string:52,
from /home/users/leopold.palomo/ros/catkin_ws_pal/src/play_motion/play_motion/include/play_motion/play_motion_helpers.h:43,
from /home/users/leopold.palomo/ros/catkin_ws_pal/src/play_motion/play_motion/src/play_motion_helpers.cpp:38:
/usr/include/c++/8/cstdlib:75:15: fatal error: stdlib.h: El fitxer o directori no existeix
#include_next <stdlib.h>
^~~~~~~~~~
compilation terminated.
[ 33%] Building CXX object CMakeFiles/pm_rrbot.dir/test/rrbot.cpp.o
make[2]: *** [CMakeFiles/play_motion_helpers.dir/build.make:63: CMakeFiles/play_motion_helpers.dir/src/play_motion_helpers.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1849: CMakeFiles/play_motion_helpers.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
In file included from /usr/include/c++/8/ext/string_conversions.h:41,
from /usr/include/c++/8/bits/basic_string.h:6400,
from /usr/include/c++/8/string:52,
from /usr/include/ros/platform.h:38,
from /usr/include/ros/time.h:53,
from /usr/include/ros/ros.h:38,
from /home/users/leopold.palomo/ros/catkin_ws_pal/src/play_motion/play_motion/test/rrbot.cpp:31:
/usr/include/c++/8/cstdlib:75:15: fatal error: stdlib.h: El fitxer o directori no existeix
#include_next <stdlib.h>
^~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/pm_rrbot.dir/build.make:63: CMakeFiles/pm_rrbot.dir/test/rrbot.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:106: CMakeFiles/pm_rrbot.dir/all] Error 2
[ 38%] Building CXX object CMakeFiles/run_motion.dir/src/run_motion_node.cpp.o
In file included from /usr/include/c++/8/ext/string_conversions.h:41,
from /usr/include/c++/8/bits/basic_string.h:6400,
from /usr/include/c++/8/string:52,
from /home/users/leopold.palomo/ros/catkin_ws_pal/src/play_motion/play_motion/src/run_motion_node.cpp:40:
/usr/include/c++/8/cstdlib:75:15: fatal error: stdlib.h: El fitxer o directori no existeix
#include_next <stdlib.h>
^~~~~~~~~~

@v-lopez
Copy link
Copy Markdown
Contributor

v-lopez commented Sep 18, 2019

Actually we need the SYSTEM for disabling warnings and build errors from system headers.

I've seen the issue you reported elsewhere, and it's even mentioned in https://gcc.gnu.org/onlinedocs/gcc/Directory-Options.html

Can you find an alternative solution that keeps the warning suppression from the included directories, but fixes your issue?

Moltes gràcies!

@lepalom
Copy link
Copy Markdown
Author

lepalom commented Sep 18, 2019

Actually we need the SYSTEM for disabling warnings and build errors from system headers.

Could you post them?

Can you find an alternative solution that keeps the warning suppression from the included directories, but fixes your issue?

I have tried several options but I think that use the SYSTEM option with the catkin_INCLUDE_DIRS is not a good idea. Could you try to do this please:

include_directories(${catkin_INCLUDE_DIRS})
+include_directories(SYSTEM ${Boost_INCLUDE_DIR})

A disposar ;-)

@v-lopez
Copy link
Copy Markdown
Contributor

v-lopez commented Sep 18, 2019

The problem is that in-house we have stricter compilation flags. We disable equality comparison of floating point values for instance.
If any included header has a d == 0.0 it will not compile.

It's a tricky situation because i don't believe we're misusing SYSTEM for this. And I haven't found an alternative (besides disabling/enabling the warnings before the external includes, which is not maintanable in all our codebase).

But on the other hand you're not doing anything wrong on your side, it's a gcc feature (or a bug¿?), but it doesn't work for you.

I'll keep an eye on the issue, I guess that this isn't blocking for you since you have it disabled on your fork. When I have time I'll try to build this on a bionic docker with gcc8,because with gcc8 it works fine.

@lepalom
Copy link
Copy Markdown
Author

lepalom commented May 28, 2020

Any new in this topic?

@v-lopez
Copy link
Copy Markdown
Contributor

v-lopez commented May 29, 2020

We are using bionic and gcc9 and it is working fine.
To be honest I don't have a solution for this. It looks to me more on a bug on the gcc side or something.

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.

2 participants