Error when compiling trunk

Get help with compiling or installing the game, and discuss announcements of new official releases.

Moderator: Forum Moderators

Post Reply
PhotonX
Posts: 24
Joined: October 3rd, 2007, 9:31 am
Location: Munich
Contact:

Error when compiling trunk

Post by PhotonX »

Hello folks!

I'm getting the following error when compiling:

Code: Select all

cc1plus: warnings being treated as errors
network.cpp: In member function »virtual void network::<unnamed>::connect_operation::run()«:
network.cpp:434: Fehler: Dereferenzierung eines Type-Pun-Zeigers verletzt strict-aliasing-Regeln
network.cpp: In function »network::connection network::<unnamed>::accept_connection_pending(std::vector<_TCPsocket*, std::allocator<_TCPsocket*> >&, _SDLNet_SocketSet*&)«:
network.cpp:522: Fehler: Dereferenzierung eines Type-Pun-Zeigers verletzt strict-aliasing-Regeln
network.cpp:537: Fehler: Dereferenzierung eines Type-Pun-Zeigers verletzt strict-aliasing-Regeln
network.cpp: In function »network::connection network::receive_data(config&, network::connection, bool*, network::bandwidth_in_ptr*)«:
network.cpp:723: Fehler: Dereferenzierung eines Type-Pun-Zeigers verletzt strict-aliasing-Regeln
network.cpp: In function »network::connection network::receive_data(std::vector<char, std::allocator<char> >&, network::bandwidth_in_ptr*)«:
network.cpp:832: Fehler: Dereferenzierung eines Type-Pun-Zeigers verletzt strict-aliasing-Regeln
make[2]: *** [network.o] Fehler 1
make[2]: Leaving directory `/home/photon/svn/wesnoth/src'
make[1]: *** [all-recursive] Fehler 1
make[1]: Leaving directory `/home/photon/svn/wesnoth'
make: *** [all] Fehler 2
Autogen ran fine, but make doesn't want to. :) Compiling on Arch Linux, 64 Bit.

Thanks,
PhotonX
Max
Posts: 1449
Joined: April 13th, 2008, 12:41 am

Re: Error when compiling trunk

Post by Max »

see here how to build without treating warnings as errors:
http://www.wesnoth.org/forum/viewtopic.php?f=4&t=25997

(can't tell how serious this warning is though...)
AI
Developer
Posts: 2396
Joined: January 31st, 2008, 8:38 pm

Re: Error when compiling trunk

Post by AI »

Run scons as:

Code: Select all

LANG="C" scons
to get the errors in english.
PhotonX
Posts: 24
Joined: October 3rd, 2007, 9:31 am
Location: Munich
Contact:

Re: Error when compiling trunk

Post by PhotonX »

Hmm, I always compiled Wesnoth with make and am not very familiar with scons, but now I compiled it with scons and strangely it compiled well though yesterday it failed to compile with make! Thanks for the hint, problem is solved.
PhotonX
Posts: 24
Joined: October 3rd, 2007, 9:31 am
Location: Munich
Contact:

Re: Error when compiling trunk

Post by PhotonX »

Hmm, I tried to play a network game and get many of these in the terminal:

Code: Select all

20090724 21:44:28 error random: Random number mismatch, mine 3164 vs 27307
Thus I and my opponent see different things happen, it's quite funny but unplayable. Often in the game an error message appears (on both sides) stating that the opponent may have cheated. Could it result from the above compilation errors? But on the other hand compiling with scons ran without errors...
AI
Developer
Posts: 2396
Joined: January 31st, 2008, 8:38 pm

Re: Error when compiling trunk

Post by AI »

PhotonX wrote:Hmm, I always compiled Wesnoth with make and am not very familiar with scons, but now I compiled it with scons and strangely it compiled well though yesterday it failed to compile with make! Thanks for the hint, problem is solved.
I must have been half asleep when I posted. You can do the same thing with make as with scons (LANG="C" make), so the errors appear in english. If wesnoth compiles with scons but not with autotools, that's a bug that needs fixing.

As for the OOS, a new RNG system is being developed, where the server generates the numbers so no clients can cheat. If you and your opponent have different versions of wesnoth, you may use different sources for your random numbers. If you have the same version however, it's a bug that needs to be reported to ilor.
User avatar
loonycyborg
Windows Packager
Posts: 295
Joined: April 1st, 2008, 4:45 pm
Location: Russia/Moscow

Re: Error when compiling trunk

Post by loonycyborg »

Those compile errors are in fact warnings. Autotools have strict compilation enabled by default while scons doesn't(since it causes errors on several gcc version/boost version combinations to no wesnoth's fault). Anyway, it can be be disabled with autotools by passing --disable-strict-compilation to ./configure or ./autogen.sh
"meh." - zookeeper
PhotonX
Posts: 24
Joined: October 3rd, 2007, 9:31 am
Location: Munich
Contact:

Re: Error when compiling trunk

Post by PhotonX »

I've installed the wesnoth-devel package from the Arch AUR (the 1.7.2 non-svn release) and everything is ok, exactly as you said. :) So, problem solved again.
Post Reply