yujinrobot / kobuki_core

Core (non-ros) kobuki packages.
68 stars 71 forks source link

backport of "Dashing update" to melodic to fix compiler warnings and errors #44

Closed meyerj closed 4 years ago

meyerj commented 5 years ago

Backport of 67a7afe4ff0f822cf1b6726a298168065758e6c6 from https://github.com/yujinrobot/kobuki_core/pull/43 to branch melodic in order to fix many compiler warnings, and even errors when building with Clang 6 (the default Clang version on Ubuntu Bionic):

kobuki_core/kobuki_ftdi/include/kobuki_ftdi/scanner.hpp:117:14: error: In file included from kobuki_core/kobuki_ftdi/src/flasher.cpp:15:                   
kobuki_core/kobuki_ftdi/src/../include/kobuki_ftdi/scanner.hppordered comparison between pointer and zero ('usb_dev_handle *' and 'int'):117                                                    
:14: error: ordered comparison between pointer and zero ('usb_dev_handle *' and 'int')                                                                                                                                               
      if ( h < 0 ) continue;                                                                                                                                                                                                         
           ~ ^ ~                                                                                                                                                                                                                     
      if ( h < 0 ) continue;                                                                                                                                                                                                         
           ~ ^ ~                                                                                                                                                                                                                     
kobuki_core/kobuki_ftdi/src/../include/kobuki_ftdi/scanner.hpp:219:11: error: ordered comparison between pointer and zero ('usb_dev_handle *' and 'int')                                        
    if( h < 0 ) {                                                                                                                                                                                                                    
        ~ ^ ~                                                                                                                                                                                                                        
kobuki_core/kobuki_ftdi/include/kobuki_ftdi/scanner.hpp:219:11: error: ordered comparison between pointer and zero ('usb_dev_handle *' and 'int')                                               
    if( h < 0 ) {                                                                                                                                                                                                                    
        ~ ^ ~                                                                                                                                                                                                                        
In file included from kobuki_core/kobuki_ftdi/src/find_devices.cpp:16:                                                                                                                          
kobuki_core/kobuki_ftdi/include/kobuki_ftdi/scanner.hpp:117:14: error: ordered comparison between pointer and zero ('usb_dev_handle *' and 'int')                                               
      if ( h < 0 ) continue;                                                                                                                                                                                                         
           ~ ^ ~                                                                                                                                                                                                                     
[ 45%] Linking CXX executable /opt/SBR-Whiz/devel/lib/kobuki_ftdi/ftdi_scan                                                                                                                                                          
kobuki_core/kobuki_ftdi/include/kobuki_ftdi/scanner.hpp:219:11: error: ordered comparison between pointer and zero ('usb_dev_handle *' and 'int')                                               
    if( h < 0 ) {                                                                                                                                                                                                                    
        ~ ^ ~                                                                                                                                                                                                                        
2 errors generated.                                                                                                                                                                                                                  
src/CMakeFiles/reset_device.dir/build.make:62: recipe for target 'src/CMakeFiles/reset_device.dir/reset_device.cpp.o' failed 

I also cherry-picked a patch from 72cb91c63d8f16bdcfe494ec4776f14030da7b82 (https://github.com/yujinrobot/kobuki_core/pull/37) to not generate version_info.cpp in the source-space.

stonier commented 4 years ago

Diverging a little from the ROS2 branches - some more static analyser fixes have gone in (#53, #54) and been handled slightly differently (e.g. completely removing unused variables from method signatures, but that shouldn't be done here since it would break abi promises for melodic).

Nonetheless, the spirit of it fits and ROS1 / ROS2 will be maintained separately henceforth, so LGTM!