Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a clang warning about uninitialized variable. #1370

Merged
merged 1 commit into from
Jun 6, 2023

Conversation

clalancette
Copy link
Contributor

In the tests for the type description hash, we were forgetting to initialize the endpoint_type, which is necessary when constructing an rclcpp::TopicEndpointInfo object. Just set it to INVALID here, as we don't care whether this is a publisher or subscriber.

In the tests for the type description hash, we were
forgetting to initialize the endpoint_type, which is
necessary when constructing an rclcpp::TopicEndpointInfo
object.  Just set it to INVALID here, as we don't care
whether this is a publisher or subscriber.

Signed-off-by: Chris Lalancette <clalancette@gmail.com>
@clalancette clalancette requested a review from a team as a code owner June 5, 2023 18:24
@clalancette clalancette requested review from MichaelOrlov and james-rms and removed request for a team June 5, 2023 18:24
@clalancette
Copy link
Contributor Author

CI:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Windows Build Status

Copy link
Contributor

@MichaelOrlov MichaelOrlov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@clalancette clalancette merged commit 76fc675 into rolling Jun 6, 2023
14 checks passed
@clalancette clalancette deleted the clalancette/fix-clang-warning branch June 6, 2023 10:50
MichaelOrlov added a commit that referenced this pull request Sep 15, 2023
Signed-off-by: Michael Orlov <michael.orlov@apex.ai>
MichaelOrlov added a commit that referenced this pull request Sep 15, 2023
…(backport #1440) (#1448)

* Fix uninitialized value pointed out by clang static analysis. (#1440)

When constructing rclcpp::TopicEndpointInfo from an
rcl_topic_endpoint_info_t, one of the fields it uses
is the 'qos_profile'.  But this particular test was forgetting
to initialize that field, leading to access of uninitialized
data.  Just set it to default here.

Signed-off-by: Chris Lalancette <clalancette@gmail.com>
(cherry picked from commit 9870868)

# Conflicts:
#	rosbag2_transport/test/rosbag2_transport/test_type_description_hash.cpp

* Fix merge conflicts and add backport for the #1370

Signed-off-by: Michael Orlov <michael.orlov@apex.ai>

---------

Signed-off-by: Michael Orlov <michael.orlov@apex.ai>
Co-authored-by: Chris Lalancette <clalancette@gmail.com>
Co-authored-by: Michael Orlov <michael.orlov@apex.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants