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

Martin Storsjö git at videolan.org
Wed Feb 28 10:58:57 CET 2018


vlc | branch: master | Martin Storsjö <martin at martin.st> | Thu Dec 14 23:16:37 2017 +0200| [89707bdde37c8b77a8cb4546166da53d4b8cc516] | committer: Martin Storsjö

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

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=89707bdde37c8b77a8cb4546166da53d4b8cc516
---

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

diff --git a/configure.ac b/configure.ac
index 4184012912..e54b19be32 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