[Scummvm-git-logs] scummvm master -> a5106d86efec7962991b7b3e80c865203027cc82

sev- noreply at scummvm.org
Tue Mar 7 19:41:21 UTC 2023


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
a5106d86ef BUILD: Disable -Wshadow and -Wmissing-field-initializers before GCC 5


Commit: a5106d86efec7962991b7b3e80c865203027cc82
    https://github.com/scummvm/scummvm/commit/a5106d86efec7962991b7b3e80c865203027cc82
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2023-03-07T20:41:16+01:00

Commit Message:
BUILD: Disable -Wshadow and -Wmissing-field-initializers before GCC 5

They just gave many false positives creating a lot of noise in build
logs for ports using an older GCC.

Changed paths:
    Makefile
    configure


diff --git a/Makefile b/Makefile
index 60056c87ee0..58db5b03a2a 100644
--- a/Makefile
+++ b/Makefile
@@ -33,7 +33,7 @@ ifeq "$(HAVE_GCC)" "1"
 	CXXFLAGS+= -Wno-long-long -Wno-multichar -Wno-unknown-pragmas -Wno-reorder
 	# Enable even more warnings...
 	CXXFLAGS+= -Wpointer-arith -Wcast-qual
-	CXXFLAGS+= -Wshadow -Wnon-virtual-dtor -Wwrite-strings
+	CXXFLAGS+= -Wnon-virtual-dtor -Wwrite-strings
 
 	# Currently we disable this gcc flag, since it will also warn in cases,
 	# where using GCC_PRINTF (means: __attribute__((format(printf, x, y))))
diff --git a/configure b/configure
index f6e3b35163d..f063110c182 100755
--- a/configure
+++ b/configure
@@ -2201,8 +2201,17 @@ if test "$have_gcc" = yes; then
 		cxx_version=`gcc_get_define __clang_version__`
 		cxx_version="`echo "${cxx_version}" | sed -e 's/"\([^ ]*\) .*/\1/'`"
 		cxx_version="clang $cxx_version, ok"
+
+		append_var CXXFLAGS "-Wshadow"
 	else
 		cxx_version="GCC $cxx_version, ok"
+
+		# Way too many false positives before GCC 5
+		if test $_cxx_major -ge 5; then
+			append_var CXXFLAGS "-Wshadow"
+		else
+			append_var CXXFLAGS "-Wno-missing-field-initializers"
+		fi
 	fi
 elif test "$have_icc" = yes; then
 	cxx_version="`( $CXX -dumpversion ) 2>/dev/null`"




More information about the Scummvm-git-logs mailing list