[Mesa-dev] [PATCH 02/19] configure: Test for -Wno-initializer-overrides

Matt Turner mattst88 at gmail.com
Mon Aug 28 21:57:04 UTC 2017


Clang has "-Wno-initializer-overrides", while gcc has
"-Wno-override-init". Quiets a lot of warnings with clang.
---
 configure.ac          | 4 ++++
 src/intel/Makefile.am | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 84b0805401..218c03dad5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -330,6 +330,10 @@ esac
 AC_SUBST([VISIBILITY_CFLAGS])
 AC_SUBST([VISIBILITY_CXXFLAGS])
 
+AX_CHECK_COMPILE_FLAG([-Wno-override-init],                    [WNO_OVERRIDE_INIT="-Wno-override-init"])         # gcc
+AX_CHECK_COMPILE_FLAG([-Wno-initializer-overrides],            [WNO_OVERRIDE_INIT="-Wno-initializer-overrides"]) # clang
+AC_SUBST([WNO_OVERRIDE_INIT])
+
 dnl
 dnl Optional flags, check for compiler support
 dnl
diff --git a/src/intel/Makefile.am b/src/intel/Makefile.am
index 9946f6752d..a34e301449 100644
--- a/src/intel/Makefile.am
+++ b/src/intel/Makefile.am
@@ -44,7 +44,7 @@ AM_CPPFLAGS = \
 
 AM_CFLAGS = \
 	$(VISIBILITY_CFLAGS) \
-	-Wno-override-init
+	$(WNO_OVERRIDE_INIT)
 
 MKDIR_GEN = $(AM_V_at)$(MKDIR_P) $(@D)
 PYTHON_GEN = $(AM_V_GEN)$(PYTHON2) $(PYTHON_FLAGS)
-- 
2.13.5



More information about the mesa-dev mailing list