1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-23 16:25:26 +03:00

address gcc9 warnings

This commit is contained in:
Jonathan Hudson 2019-05-04 18:22:18 +01:00
parent 3cdeacbd54
commit 8372958f46
2 changed files with 15 additions and 0 deletions

View file

@ -1045,6 +1045,13 @@ static void writeInterframe(void)
blackboxLoggedAnyFrames = true;
}
// for gcc9 (and maybe later), we warn on (mainly harmless) unaligned packed structure member pointer access
// minimise the effect to the affected functions and compiler versions.
#if (__GNUC__ >= 9)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Waddress-of-packed-member"
#endif
/* Write the contents of the global "slowHistory" to the log as an "S" frame. Because this data is logged so
* infrequently, delta updates are not reasonable, so we log independent frames. */
static void writeSlowFrame(void)
@ -1131,6 +1138,10 @@ static void loadSlowState(blackboxSlowState_t *slow)
}
#if (__GNUC__ >= 9)
#pragma GCC diagnostic pop
#endif
/**
* If the data in the slow frame has changed, log a slow frame.
*

View file

@ -75,6 +75,10 @@
// until this is resolved in mavlink library - ignore -Wpedantic for mavlink code
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpedantic"
// For gcc9, the mavlink libary also fails on unaligned unaligned packed structure member pointer access
#if (__GNUC__ >= 9)
#pragma GCC diagnostic ignored "-Waddress-of-packed-member"
#endif
#include "common/mavlink.h"
#pragma GCC diagnostic pop