[vlc-commits] configure: Try to add -Wno-incompatible-ms-struct if adding -mms-bitfields

Martin Storsjö git at videolan.org
Fri Nov 23 16:11:03 CET 2018


vlc/vlc-3.0 | branch: master | Martin Storsjö <martin at martin.st> | Thu Dec 14 23:16:37 2017 +0200| [93e305002e186fa6cf9bef18c2569128284905eb] | committer: Hugo Beauzée-Luyssen

configure: Try to add -Wno-incompatible-ms-struct if adding -mms-bitfields

This avoids warnings that are treated as errors by default when building
with clang - warnings like these:

In file included from modules/access/dcp/dcp.cpp:59:
In file included from contrib/x86_64-w64-mingw32/include/AS_DCP.h:88:
In file included from contrib/x86_64-w64-mingw32/include/KM_fileio.h:35:
contrib/x86_64-w64-mingw32/include/KM_util.h:48:11: error: ms_struct may not produce Microsoft-compatible layouts for classes with base classes or virtual functions [-Wincompatible-ms-struct]
    class IntPrinter : public std::string

(cherry picked from commit 89707bdde37c8b77a8cb4546166da53d4b8cc516)
Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=93e305002e186fa6cf9bef18c2569128284905eb
---

 configure.ac | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/configure.ac b/configure.ac
index 28f820dcdb..00c66b2054 100644
--- a/configure.ac
+++ b/configure.ac
@@ -544,6 +544,13 @@ dnl Check for broken versions of mingw-runtime compatability library
     AX_CHECK_COMPILE_FLAG([-mms-bitfields], [
         AX_APPEND_FLAG([-mms-bitfields], [CFLAGS])
         AX_APPEND_FLAG([-mms-bitfields], [CXXFLAGS])
+        # Check for the warning flag without "-Wno-", GCC accepts
+        # -Wno-<anything> for unsupported warnings, which can trigger
+        # other warnings instead.
+        AX_CHECK_COMPILE_FLAG([-Wincompatible-ms-struct], [
+            AX_APPEND_FLAG([-Wno-incompatible-ms-struct], [CFLAGS])
+            AX_APPEND_FLAG([-Wno-incompatible-ms-struct], [CXXFLAGS])
+        ])
     ], [
         AX_CHECK_COMPILE_FLAG([-fnative-struct], [
             AX_APPEND_FLAG([-fnative-struct], [CFLAGS])



More information about the vlc-commits mailing list