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 various gcc11 warnings [12970] #2323

Merged
merged 6 commits into from
Nov 24, 2021
Merged

Conversation

MiguelCompany
Copy link
Member

This is a port of #2321 to the master branch

clalancette and others added 6 commits November 22, 2021 14:16
This ensures that the pid always has a value, and gets rid
of a gcc 11 warning about pid being possibly uninitialized.

Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
Since this can fail, the return value (in the last parameter)
may not get set.  Always check the return value, which gets
rid of some warnings with gcc 11.

Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
gcc 11 pointed out that we could sometimes return a stack
pointer from within sqlite3SelectNew().  That could only
happen in Release mode (where asserts are disabled), but
that is still a problem.  I took a look at upstream sqlite3
(3.36), and saw that this had already been fixed.  This is
a backport of just that fix.

Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
gcc 11 points out that the array of ListenerStatus structures
are not POD types, and so using a simple memset on them could
be dangerous.  Instead, switch to 'std::fill_n' with this,
which necessitated adding some new constructors to the non-POD
types.

Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>
Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>
@MiguelCompany
Copy link
Member Author

@richiprosima Please test this

1 similar comment
@MiguelCompany
Copy link
Member Author

@richiprosima Please test this

@MiguelCompany
Copy link
Member Author

Failures are all known flakey tests

@MiguelCompany MiguelCompany merged commit e75d208 into master Nov 24, 2021
@MiguelCompany MiguelCompany deleted the hotfix/fix-gcc-11-warnings branch November 24, 2021 15:35
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.

2 participants