From 92927240a9fa4a534aa7d4ba8df11af7f3174e1b Mon Sep 17 00:00:00 2001 From: Arne-W Date: Sat, 28 May 2022 15:11:42 +0200 Subject: [PATCH] mavlink: Supress gcc warnings when using mavlink includes. --- .../include/mavlink/v2.0/ardupilotmega/mavlink.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/libs/mavlink/include/mavlink/v2.0/ardupilotmega/mavlink.h b/libs/mavlink/include/mavlink/v2.0/ardupilotmega/mavlink.h index 6e7992f9b..243a33907 100644 --- a/libs/mavlink/include/mavlink/v2.0/ardupilotmega/mavlink.h +++ b/libs/mavlink/include/mavlink/v2.0/ardupilotmega/mavlink.h @@ -28,7 +28,19 @@ #define MAVLINK_COMMAND_24BIT 1 #endif +// 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 + + #endif // MAVLINK_H