mstflint/Fix-gcc7-and-gcc8.patch

38 lines
1.3 KiB
Diff

commit 6a8758e9353447abdb9366638790984e84b04eb1
Author: Nicolas Morey-Chaisemartin <NMoreyChaisemartin@suse.com>
Date: Wed Aug 9 17:31:57 2017 +0200
Fix gcc7 and gcc8
Fix compilation errors for GCC7 and GCC8
Signed-off-by: Nicolas Morey-Chaisemartin <NMoreyChaisemartin@suse.com>
diff --git configure.ac configure.ac
index 4d549ee4cb79..c8e15447f5e1 100644
--- configure.ac
+++ configure.ac
@@ -308,6 +308,7 @@ AM_CONDITIONAL([USE_LOCAL_SQLITE], [test "$SQLITE_SYSTEM_AVAILABLE" = no])
CFLAGS="$CFLAGS -DMST_UL"
+CPPFLAGS="$CPPFLAGS -DMST_UL"
CXXFLAGS="$CXXFLAGS -DMST_UL"
@@ -336,6 +337,14 @@ AX_CHECK_COMPILE_FLAG([-Wno-implicit-fallthrough], [CFLAGS="$CFLAGS -Wno-implici
AX_CHECK_COMPILE_FLAG([-Wno-cast-function-type], [CFLAGS="$CFLAGS -Wno-cast-function-type"], [], [])
CFLAGS="$OLD_CFLAGS"
+# C GCC [78] related ignores
+OLD_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS -Wall -Werror"
+AX_CHECK_COMPILE_FLAG([-Wno-format-overflow], [CPPFLAGS="$CPPFLAGS -Wno-format-overflow"], [], [])
+AX_CHECK_COMPILE_FLAG([-Wno-implicit-fallthrough], [CPPFLAGS="$CPPFLAGS -Wno-implicit-fallthrough"], [], [])
+AX_CHECK_COMPILE_FLAG([-Wno-cast-function-type], [CPPFLAGS="$CPPFLAGS -Wno-cast-function-type"], [], [])
+CPPFLAGS="$OLD_CPPFLAGS"
+
# C++ related ignores
OLD_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS -Wall -Werror"