summaryrefslogtreecommitdiff
path: root/config.lib
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2011-08-07 11:18:33 +0000
committersmatz <smatz@openttd.org>2011-08-07 11:18:33 +0000
commit6e99c400879f2bd4dbf7f28b739c2e034fdcbeeb (patch)
tree590f7edc177bb62c6f51d59c798a04180ca0cc08 /config.lib
parent6a87848809df45a186e791e7042c7523af378279 (diff)
downloadopenttd-6e99c400879f2bd4dbf7f28b739c2e034fdcbeeb.tar.xz
(svn r22728) -Codechange: add -Wno-narrowing to cxxflags in order to prevent many useless warnings with GCC 4.7
Diffstat (limited to 'config.lib')
-rw-r--r--config.lib7
1 files changed, 7 insertions, 0 deletions
diff --git a/config.lib b/config.lib
index 6fee37cca..523b6104c 100644
--- a/config.lib
+++ b/config.lib
@@ -1299,6 +1299,13 @@ make_compiler_cflags() {
cxxflags="$cxxflags -std=gnu++0x"
fi
+ if [ $cc_version -ge 47 ]; then
+ # Disable -Wnarrowing which gives many warnings, such as:
+ # warning: narrowing conversion of '...' from 'unsigned int' to 'int' inside { } [-Wnarrowing]
+ # They are valid according to the C++ standard, but useless.
+ cxxflags="$cxxflags -Wno-narrowing"
+ fi
+
if [ "$enable_lto" != "0" ]; then
# GCC 4.5 outputs '%{flto}', GCC 4.6 outputs '%{flto*}'
has_lto=`$1 -dumpspecs | grep '\%{flto'`