ros / roscpp_core

ros distribution sandbox
88 stars 116 forks source link

Fix build warnings with recent boost libraries (>= 1.67) #118

Closed myungjoo closed 4 years ago

myungjoo commented 4 years ago

With https://github.com/boostorg/date_time/commit/f9f2aaf5216c we need to update the usage of duration. Reference: https://github.com/Icinga/icinga2/pull/6230

Signed-off-by: MyungJoo Ham myungjoo.ham@samsung.com

dirk-thomas commented 4 years ago

Can you please provide more details about your exact environment as well as the specific error message you are seeing?

I can build the current state of the target branch just fine on Ubuntu Focal which has Boost 1.67.0 - same for the buildfarm which has built the package as well as downstream packages using it just fine.

myungjoo commented 4 years ago

I'm using gcc-9 with strict build options that do not ignore warnings.

gcc-c++-9.2.0 glibc-devel-2.30 boost-devel-1.71

[   60s] In file included from /home/abuild/rpmbuild/BUILD/ros-kinetic-cpp-common-0.6.5/rostime/src/duration.cpp:35:
[   60s] /home/abuild/rpmbuild/BUILD/ros-kinetic-cpp-common-0.6.5/rostime/include/ros/impl/duration.h: In instantiation of 'boost::posix_time::time_duration ros::DurationBase<T>::toBoost() const [with T = ros::Duration]':
[   60s] /home/abuild/rpmbuild/BUILD/ros-kinetic-cpp-common-0.6.5/rostime/src/duration.cpp:75:18:   required from here
[   60s] /home/abuild/rpmbuild/BUILD/ros-kinetic-cpp-common-0.6.5/rostime/include/ros/impl/duration.h:182:35: error: no matching function for call to 'boost::date_time::subsecond_duration<boost::posix_time::time_duration, 1000000>::subsecond_duration(double)'
[   60s]   182 |     return bt::seconds(sec) + bt::microseconds(nsec/1000.0);
[   60s]       |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~
[   60s] In file included from /usr/include/boost/date_time/posix_time/posix_time_config.hpp:16,
[   60s]                  from /usr/include/boost/date_time/posix_time/posix_time_system.hpp:13,
[   60s]                  from /usr/include/boost/date_time/posix_time/ptime.hpp:12,
[   60s]                  from /usr/include/boost/date_time/posix_time/posix_time_types.hpp:12,
[   60s]                  from /home/abuild/rpmbuild/BUILD/ros-kinetic-cpp-common-0.6.5/rostime/include/ros/impl/duration.h:39,
[   60s]                  from /home/abuild/rpmbuild/BUILD/ros-kinetic-cpp-common-0.6.5/rostime/src/duration.cpp:35:

I believe this is related with GCC-9 + Boost-recent because this code was ok with GCC-6 + Boost-a--bit-old.

dirk-thomas commented 4 years ago

The Jenkins job doesn't show any compiler warnings: http://build.ros.org/view/Ndev/job/Ndev__roscpp_core__ubuntu_focal_amd64/6/

Can you please show the exact compiler warning you see with the latest state of the targeted branch (noetic-devel)?

Also you error message shows kinetic which isn't the targeted branch of this patch.

dirk-thomas commented 4 years ago

Closing due to no further response from the author.