Return-To-The-Roots / s25edit

Fork of Launchpad: Worldeditor by XaserLe
https://code.launchpad.net/~xaserle/s25rttr/s25edit
4 stars 4 forks source link

BUG: compile failure on gcc 6.4 #4

Closed Flow86 closed 6 years ago

Flow86 commented 6 years ago
[ 97%] Building CXX object s25edit/CMakeFiles/s25edit.dir/CSurface.cpp.o
In static member function 'static void CSurface::DrawTriangleField(SDL_Surface*, DisplayRectangle, bobMAP*)':
cc1plus: error: assuming signed overflow does not occur when assuming that (X - c) > X is always false [-Werror=strict-overflow]
cc1plus: all warnings being treated as errors
s25edit/CMakeFiles/s25edit.dir/build.make:284: recipe for target 's25edit/CMakeFiles/s25edit.dir/CSurface.cpp.o' failed

( I don't know why the gcc does not say which line ...)

Flamefire commented 6 years ago

Gcc 6.4 in ubuntu does not show this. Trying Gcc7 What is the exact gcc version you are using?

Flow86 commented 6 years ago

plain gcc from https://gcc.gnu.org/

Using built-in specs.
COLLECT_GCC=/usr/bin/i386-apple-darwin15-gcc-6.4.0
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i386-apple-darwin15/6.4.0/lto-wrapper
Target: i386-apple-darwin15
Configured with: /var/lib/jenkins/workspace/apple-gcc_master-PRYWXQFHVAR7TKGYXA5NK3TT5QUOPFRIMXGBMYEGLJEAG76S7KVQ/build/gcc-6.4.0-i386-apple-darwin15/configure --enable-multilib --with-multilib-list=m32,m64 --target=i386-apple-darwin15 --prefix=/usr --with-sysroot=/usr/lib/apple/SDKs/MacOSX10.11.sdk --with-slibdir=/usr/i386-apple-darwin15/lib --mandir=/usr/i386-apple-darwin15/share/man --infodir=/usr/i386-apple-darwin15/share/info --libexecdir=/usr/lib --datarootdir=/usr/i386-apple-darwin15/share --disable-nls --enable-lto --with-system-zlib --with-gxx-include-dir=/usr/i386-apple-darwin15/include/c++/4.2.1 --enable-languages=c,c++,objc,obj-c++,lto --enable-version-specific-runtime-libs DSYMUTIL=i386-apple-darwin15-dsymutil
Thread model: posix
gcc version 6.4.0 (GCC)
Flow86 commented 6 years ago

https://stackoverflow.com/questions/12984861/dont-understand-assuming-signed-overflow-warning

we could add -Wno-error=strict-overflow

Flamefire commented 6 years ago

As a last resort yes. However it could be an actual problem so I'd like to find the issue.

Flamefire commented 6 years ago

Could you check with the latest commit of s25edit? PR in progress,

Flow86 commented 6 years ago

seems to work