Revision 6559 FTBFS on GNU/Linux due to compile_assert failing

Bug #1171131 reported by Hans Joachim Desserud on 2013-04-21
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Critical
Unassigned

Bug Description

With revision 6559, WL fails to build on GNU/Linux (tried with Ubuntu and Arch) with the following error message:

Scanning dependencies of target widelands_all
[ 1%] Building CXX object src/CMakeFiles/widelands_all.dir/network/netclient.cc.o
In file included from /home/arch/widelands/src/logic/widelands_geometry.h:23:0,
                 from /home/arch/widelands/src/logic/notification.h:24,
                 from /home/arch/widelands/src/chat.h:26,
                 from /home/arch/widelands/src/network/netclient.h:23,
                 from /home/arch/widelands/src/network/netclient.cc:20:
/home/arch/widelands/src/compile_assert.h:27:91: error: size of array ‘COMPILE_ASSERT_239’ is negative
 #define compile_assert(x) typedef bool TOKENPASTE2(COMPILE_ASSERT_, __LINE__)[(x) ? 1 : -1]
                                                                                           ^
/home/arch/widelands/src/logic/field.h:239:1: note: in expansion of macro ‘compile_assert’
 compile_assert(sizeof(Field) == sizeof(void*)*2 + 10);
 ^
make[2]: *** [src/CMakeFiles/widelands_all.dir/network/netclient.cc.o] Error 1
make[1]: *** [src/CMakeFiles/widelands_all.dir/all] Error 2
make: *** [all] Error 2

r6558 worked fine, and it also seems pretty clear from the commit message[1] this change caused the problem. I guess we will need to either
A) wrap this in IFDEFs to support all platforms (which sounds messy), or
B) find some better way to do this check

[1] http://bazaar.launchpad.net/~widelands-dev/widelands/trunk/revision/6559

Tino (tino79) wrote :

Sorry, my fault. Somehow i thought the check is <= instead of ==.
Now using #defs to determine win32 platform.

Hans Joachim Desserud (hjd) wrote :

Thanks, I can verify it works again now. :)

I do wonder whether other, more obscure platforms will need similar ifdefs though...

Changed in widelands:
status: New → Fix Committed
SirVer (sirver) wrote :

I replaced the == through <= to avoid the ifdefs. Thanks for testing Tino!

SirVer (sirver) wrote :

Released in build-18 rc1.

Changed in widelands:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers