Changeset - r7406:1c263f54b76a
[Not reviewed]
master
0 1 0
rubidium - 17 years ago 2007-08-04 00:45:53
rubidium@openttd.org
(svn r10779) -Fix: GCC 4.2 makes (by default for -O2, -O3 and -Os) an assumption that signed integers do not overflow, whereas it is very likely that some of the legacy code does so. It furthermore breaks with the assumed standard (the behaviour is not actually defined in the standard) about the behaviour when signed integers wrap.
1 file changed with 8 insertions and 0 deletions:
0 comments (0 inline, 0 general)
config.lib
Show inline comments
 
@@ -835,12 +835,20 @@ make_cflags_and_ldflags() {
 
	#  break anything. So disable strict-aliasing to make the
 
	#  compiler all happy.
 
	if [ $cc_version -ge 40 ]; then
 
		CFLAGS="$CFLAGS -fno-strict-aliasing"
 
	fi
 

	
 
	# GCC 4.2+ automatically assumes that signed overflows do
 
	# not occur in signed arithmetics, whereas we are not
 
	# sure that they will not happen. It furthermore complains
 
	# about it's own optimized code in some places.
 
	if [ $cc_version -ge 42 ]; then
 
		CFLAGS="$CFLAGS -fno-strict-overflow"
 
	fi
 

	
 
	if [ "$os" != "CYGWIN" ] && [ "$os" != "FREEBSD" ] && [ "$os" != "OPENBSD" ] && [ "$os" != "MINGW" ] && [ "$os" != "MORPHOS" ] && [ "$os" != "OSX" ] && [ "$os" != "WINCE" ] && [ "$os" != "PSP" ] && [ "$os" != "OS2" ]; then
 
		LIBS="$LIBS -lpthread"
 
		LIBS="$LIBS -lrt"
 
	fi
 

	
 
	if [ "$os" != "CYGWIN" ] && [ "$os" != "MINGW" ] && [ "$os" != "WINCE" ]; then
0 comments (0 inline, 0 general)