ros2 / rmw_cyclonedds

ROS 2 RMW layer for Eclipse Cyclone DDS
Apache License 2.0
108 stars 89 forks source link

Fix a warning by making a pointer nullptr. #375

Closed clalancette closed 2 years ago

clalancette commented 2 years ago

When building on Ubuntu 22.04 in Release mode, gcc complains that:

‘stact’ may be used uninitialized in this function [-Wmaybe-uninitialized] 2295

I think this is probably a false positive; in any situations where stact was not set, we would have gotten out before this. Regardless, just set stact to nullptr, which quiets the warning and should have no deleterious effects.

Signed-off-by: Chris Lalancette clalancette@openrobotics.org

This should fix warnings from the nightlies like the last one shown in https://ci.ros2.org/view/nightly/job/nightly_linux_release/2205/gcc/new/

clalancette commented 2 years ago

CI:

clalancette commented 2 years ago

Linux aarch64 warnings are from other problems that need to be fixed. This improves the situation, so going ahead and merging this one.