Changeset - r17913:b411192e7742
[Not reviewed]
master
0 1 0
smatz - 13 years ago 2011-08-07 11:18:33
smatz@openttd.org
(svn r22728) -Codechange: add -Wno-narrowing to cxxflags in order to prevent many useless warnings with GCC 4.7
1 file changed with 7 insertions and 0 deletions:
0 comments (0 inline, 0 general)
config.lib
Show inline comments
 
@@ -1290,24 +1290,31 @@ make_compiler_cflags() {
 
			flags="$flags -fno-strict-overflow"
 
			# GCC 4.2 no longer includes -Wnon-virtual-dtor in -Wall.
 
			# Enable it in order to be consistent with older GCC versions.
 
			flags="$flags -Wnon-virtual-dtor"
 
		fi
 

	
 
		if [ $cc_version -ge 43 ]; then
 
			# Use gnu++0x mode so static_assert() is available.
 
			# Don't use c++0x, it breaks mingw (with gcc 4.4.0).
 
			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'`
 
			if [ -n "$has_lto" ]; then
 
				# Use LTO only if we see LTO exists and is requested
 
				if [ $cc_version -lt 46 ]; then
 
					flags="$flags -flto"
 
				else
 
					flags="$flags -flto=jobserver"
 
				fi
 
				ldflags="$ldflags -fwhole-program"
 
				features="$features lto"
0 comments (0 inline, 0 general)