FraunhoferIOSB / camera_aravis2

ROS2 camera driver for GenICam-based GigEVision and USB3Vision cameras.
BSD 3-Clause "New" or "Revised" License
15 stars 2 forks source link

compile warnings #42

Open rursprung opened 1 day ago

rursprung commented 1 day ago

FYI: there are a couple of compile warnings when building this from the current tip of the main branch (commit 8acd8251f9c77784987dc6f1abfc64bf58576e3f):

[Processing: camera_aravis2]
--- stderr: camera_aravis2
.../src/camera_aravis2/camera_aravis2/src/camera_aravis_node_base.cpp:363:10: warning: variable 'is_successful' set but not used [-Wunused-but-set-variable]
  363 |     bool is_successful = true;
      |          ^
.../src/camera_aravis2/camera_aravis2/src/camera_driver.cpp:2079:30: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
 2079 |         RCLCPP_WARN(logger_, warn_msg.c_str());
      |                              ^~~~~~~~~~~~~~~~
/opt/ros/jazzy/include/rclcpp/rclcpp/logging.hpp:957:7: note: expanded from macro 'RCLCPP_WARN'
  957 |       __VA_ARGS__); \
      |       ^~~~~~~~~~~
/opt/ros/jazzy/include/rcutils/rcutils/logging_macros.h:763:5: note: expanded from macro 'RCUTILS_LOG_WARN_NAMED'
  763 |     __VA_ARGS__)
      |     ^~~~~~~~~~~
/opt/ros/jazzy/include/rcutils/rcutils/logging_macros.h:81:73: note: expanded from macro 'RCUTILS_LOG_COND_NAMED'
   81 |       rcutils_log_internal(&__rcutils_logging_location, severity, name, __VA_ARGS__); \
      |                                                                         ^~~~~~~~~~~
.../src/camera_aravis2/camera_aravis2/src/camera_driver.cpp:2079:30: note: treat the string as an argument to avoid this
 2079 |         RCLCPP_WARN(logger_, warn_msg.c_str());
      |                              ^
      |                              "%s",
/opt/ros/jazzy/include/rclcpp/rclcpp/logging.hpp:957:7: note: expanded from macro 'RCLCPP_WARN'
  957 |       __VA_ARGS__); \
      |       ^
/opt/ros/jazzy/include/rcutils/rcutils/logging_macros.h:763:5: note: expanded from macro 'RCUTILS_LOG_WARN_NAMED'
  763 |     __VA_ARGS__)
      |     ^
/opt/ros/jazzy/include/rcutils/rcutils/logging_macros.h:81:73: note: expanded from macro 'RCUTILS_LOG_COND_NAMED'
   81 |       rcutils_log_internal(&__rcutils_logging_location, severity, name, __VA_ARGS__); \
      |                                                                         ^
1 warning generated.
1 warning generated.
---

it might be worthwhile to add -Werror to the build to ensure that there are no warnings?