Legohead259 / OlympianESC-Firmware

Firmware for a novel Micro-ROS based electronic speed controller (ESC)
MIT License
0 stars 0 forks source link

[Bug Report] : Unused function returns in `micro_ros_bldc.cpp` #26

Closed Legohead259 closed 9 months ago

Legohead259 commented 9 months ago

Describe the bug There are several ROS RCL functions that have returns, but they are not currently used. This is leading to compiler warnings and loss of features that could be useful.

Compiler output

src/micro_ros_bldc.cpp: In function 'void destroyEntities()':
src/micro_ros_bldc.cpp:111:23: warning: ignoring return value of 'rcl_ret_t rcl_publisher_fini(rcl_publisher_t*, rcl_node_t*)', declared with attribute warn_unused_result [-Wunused-result]
     rcl_publisher_fini(&angularPositionPublisher, &node);
     ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/micro_ros_bldc.cpp:112:19: warning: ignoring return value of 'rcl_ret_t rcl_timer_fini(rcl_timer_t*)', declared with attribute warn_unused_result [-Wunused-result]
     rcl_timer_fini(&angularPositionTimer);
     ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
src/micro_ros_bldc.cpp:113:19: warning: ignoring return value of 'rcl_ret_t rcl_timer_fini(rcl_timer_t*)', declared with attribute warn_unused_result [-Wunused-result]
     rcl_timer_fini(&neopixelTimer);
     ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
src/micro_ros_bldc.cpp:114:21: warning: ignoring return value of 'rcl_ret_t rcl_service_fini(rcl_service_t*, rcl_node_t*)', declared with attribute warn_unused_result [-Wunused-result]
     rcl_service_fini(&setTargetService, &node);
     ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
src/micro_ros_bldc.cpp:116:18: warning: ignoring return value of 'rcl_ret_t rcl_node_fini(rcl_node_t*)', declared with attribute warn_unused_result [-Wunused-result]
     rcl_node_fini(&node);
Legohead259 commented 9 months ago

Can put each of these calls into RCSOFTCHECK() for now.