[Scummvm-git-logs] scummvm master -> 8e31ffa2328bbbfa358530d231dfa5c140b3f15a

sev- sev at scummvm.org
Sat Aug 19 11:08:18 CEST 2017


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:
8e31ffa232 CONFIGURE: Silence undefined-var-template warning


Commit: 8e31ffa2328bbbfa358530d231dfa5c140b3f15a
    https://github.com/scummvm/scummvm/commit/8e31ffa2328bbbfa358530d231dfa5c140b3f15a
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2017-08-19T11:08:14+02:00

Commit Message:
CONFIGURE: Silence undefined-var-template warning

We get this warning a lot for the Singleton class due to the way
we instantiate its specializations. Also in case we forget the
instantiation we get a link error anyway, so the warning is not
very useful anyway.

Changed paths:
    configure


diff --git a/configure b/configure
index 4d8c235..3f35902 100755
--- a/configure
+++ b/configure
@@ -164,6 +164,7 @@ _build_scalers=yes
 _build_hq_scalers=yes
 _enable_prof=no
 _global_constructors=no
+_no_undefined_var_template=no
 _bink=yes
 _cloud=auto
 # Default vkeybd/keymapper/eventrec options
@@ -2023,13 +2024,30 @@ echocheck "whether -Wglobal-constructors work"
 cat > $TMPC << EOF
 int main() { return 0; }
 EOF
-cc_check -Wglobal-constructors && _global_constructors=yes
+cc_check -Wglobal-constructors -Werror && _global_constructors=yes
 
 if test "$_global_constructors" = yes; then
 	append_var CXXFLAGS "-Wglobal-constructors"
 fi
 echo $_global_constructors
 
+# If the compiler supports the -Wundefined-var-template flag, silence that warning.
+# We get this warning a lot with regard to the Singleton class as we explicitly
+# instantiate each specialisation. An alternate way to deal with it would be to
+# change the way we instantiate the singleton classes as done in PR #967.
+# Note: we check the -Wundefined-var-template as gcc does not error out on unknown
+# -Wno-xxx flags.
+echocheck "whether -Wno-undefined-var-template work"
+cat > $TMPC << EOF
+int main() { return 0; }
+EOF
+cc_check -Wundefined-var-template -Werror && _no_undefined_var_template=yes
+
+if test "$_no_undefined_var_template" = yes; then
+	append_var CXXFLAGS "-Wno-undefined-var-template"
+fi
+echo $_no_undefined_var_template
+
 echo_n "Checking for $_host_alias-strings... " >> "$TMPLOG"
 if `which $_host_alias-strings >/dev/null 2>&1`; then
 _strings=$_host_alias-strings





More information about the Scummvm-git-logs mailing list