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

Update mavlink version #1266

Merged
merged 5 commits into from
Nov 9, 2022
Merged

Conversation

andyp1per
Copy link
Contributor

No description provided.

Comment on lines 31 to 45
// gcc version 9 brings a lot of new warnings. We supress them here for the mavlink
// library as it is not "our" code
#if defined(__GNUC__) && (__GNUC__ > 8)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Waddress-of-packed-member" // Suppress lots of warnings
#endif

#include "version.h"
#include "ardupilotmega.h"

#if defined(__GNUC__) && (__GNUC__ > 8)
#pragma GCC diagnostic pop
#endif


Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please migrate this change into the new version?? Without it the build generates thousands of warnings with newer gcc compilers. Moreover it would be very cool if you could add

#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#pragma GCC diagnostic ignored "-Wuninitialized"

to the first block to silence all warnings emitted by mavlink.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@peterbarker this should be part of the mavlink generation step in AP - any idea how we can fix that up?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Arne-W we think that this problem was largely resolved in mavlink at the end of last year, did you actually try the update?

Copy link
Contributor

Choose a reason for hiding this comment

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

@andyp1per Yes I built the change and got round about 3000 warnings. But to be absolutely sure I will check it again and inform you about the compiler and the options we are using.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, thanks - I will double check the versions of the generator I used just to make sure I didn't miss a version

Copy link
Contributor

Choose a reason for hiding this comment

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

So I built from scratch on a new Kubuntu 22.04 with gcc 11.3.0 and I get more than 4000 warnings (counting all the duplicates).

mavlink_msg_obstacle_distance.h:173:158: warning: taking address of packed member of ‘__mavlink_obstacle_distance_t’ may result in an unaligned pointer value [-Waddress-of-packed-member]

We are building with -Wall -Wextra. Adding the diagnostic ignore pragma removes all warnings generated by mavlink.

@Arne-W
Copy link
Contributor

Arne-W commented Nov 9, 2022

Nice - Thank you very much. 👍

@Arne-W Arne-W merged commit 0bd3a79 into ArduPilot:master Nov 9, 2022
@andyp1per andyp1per deleted the pr-mavlink-update branch November 9, 2022 10:29
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