From 6a7c02f5a745ecfdf132d533c137a82e8023d09a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Wed, 19 Feb 2020 15:39:54 -0300 Subject: [PATCH] QGCMavlink: Add GCC version check to use address-of-packed-member MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrick José Pereira --- src/comm/QGCMAVLink.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/comm/QGCMAVLink.h b/src/comm/QGCMAVLink.h index 202fee0eb..19f710bd2 100644 --- a/src/comm/QGCMAVLink.h +++ b/src/comm/QGCMAVLink.h @@ -22,8 +22,15 @@ // Ignore warnings from mavlink headers for both GCC/Clang and MSVC #ifdef __GNUC__ + +#if __GNUC__ > 8 #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Waddress-of-packed-member" +#else +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wall" +#endif + #else #pragma warning(push, 0) #endif -- 2.22.0