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 spurious bug because class field was uninitialized. #1670

Merged
merged 1 commit into from
Dec 7, 2021

Conversation

windelbouwman
Copy link
Contributor

This bug caused mavros to crash randomly. Is there maybe a check that can be enabled in g++ to catch these kind of bugs?

Rationale:
For basic types, fields get initialized with there default value, but struct types get garbled memory, unless passed an initializer list.

See also: https://en.cppreference.com/w/cpp/language/default_initialization

Copy link
Member

@vooon vooon left a comment

Choose a reason for hiding this comment

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

LGTM, Thanks!

@vooon vooon added this to the Version 2.1 milestone Dec 7, 2021
@vooon vooon merged commit da57532 into mavlink:ros2 Dec 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants