From efcd990cd41b49a8dda4bb8fa1dd1b648210c4d9 Mon Sep 17 00:00:00 2001 From: Aleksey Kontsevich Date: Mon, 25 May 2020 21:15:14 +0300 Subject: [PATCH] Removed -Waddress-of-packed-member warning disabling --- QGCCommon.pri | 2 -- src/Vehicle/Vehicle.h | 13 +++++++++++++ src/uas/UAS.h | 13 +++++++++++++ 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/QGCCommon.pri b/QGCCommon.pri index 0d6be1126..5820b7603 100644 --- a/QGCCommon.pri +++ b/QGCCommon.pri @@ -50,7 +50,6 @@ linux { DEFINES += QGC_GST_TAISYNC_ENABLED DEFINES += QGC_GST_MICROHARD_ENABLED QMAKE_CXXFLAGS_WARN_ON += -Werror \ - -Wno-address-of-packed-member \ # Mavlink headers -Wno-unused-parameter \ # gst_plugins-good has these errors -Wno-implicit-fallthrough \ # gst_plugins-good has these errors -Wno-unused-command-line-argument \ # from somewhere in Qt generated build files @@ -118,7 +117,6 @@ linux { #QMAKE_MAC_SDK = macosx10.15 QMAKE_CXXFLAGS += -fvisibility=hidden QMAKE_CXXFLAGS_WARN_ON += -Werror \ - -Wno-address-of-packed-member \ # Mavlink headers -Wno-unused-parameter # gst-plugins-good } else { error("Unsupported Mac toolchain, only 64-bit LLVM+clang is supported") diff --git a/src/Vehicle/Vehicle.h b/src/Vehicle/Vehicle.h index 14ecd4a40..bd5ac5a55 100644 --- a/src/Vehicle/Vehicle.h +++ b/src/Vehicle/Vehicle.h @@ -9,9 +9,22 @@ #pragma once +// 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" +#elif defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Waddress-of-packed-member" +#else +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wall" +#endif + +#else +#pragma warning(push, 0) #endif #include diff --git a/src/uas/UAS.h b/src/uas/UAS.h index 331eb4f28..6788cbeb6 100644 --- a/src/uas/UAS.h +++ b/src/uas/UAS.h @@ -13,9 +13,22 @@ #pragma once +// 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" +#elif defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Waddress-of-packed-member" +#else +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wall" +#endif + +#else +#pragma warning(push, 0) #endif #include "UASInterface.h" -- 2.22.0