Compile warnings /lib/netplay.c

Discuss the future of Warzone 2100 with us.
R3dP!pe
Greenhorn
Posts: 12
Joined: 26 Apr 2008, 13:29

Compile warnings /lib/netplay.c

Post by R3dP!pe »

I want to modify the intelligence menu a bit, so I downloaded and compiled the svn trunk. I'm using Ubuntu 7.10 and your description in the Wiki worked fine (except that the required flex version is newer than the Ubuntu package).

But make failed because of 3 warnings in /lib/netplay.c. In lines 1620, 1251 and 1530 the function SDLNet_TCP_Send() is given a const char*, but the function seems to remove the const qualifier:
msgid "passing argument %d of %qE discards qualifiers from pointer target type"

When I add a typecast to char* (SDLNet_TCP_Send(tcp_socket, (char*)"list", 5); ) it compiles. ;)

Hooray for const correctness!  ::)
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: Compile warnings /lib/netplay.c

Post by Per »

What version of gcc are you using?
"Make a man a fire, you keep him warm for a day. Set a man on fire, you keep him warm for the rest of his life."
User avatar
DevUrandom
Regular
Regular
Posts: 1690
Joined: 31 Jul 2006, 23:14

Re: Compile warnings /lib/netplay.c

Post by DevUrandom »

Also interesting: Which version of SDL_net is that?
R3dP!pe
Greenhorn
Posts: 12
Joined: 26 Apr 2008, 13:29

Re: Compile warnings /lib/netplay.c

Post by R3dP!pe »

libsdl1.2debian is version 1.2.11-9ubuntu2, also libsdl1.2-dev is 1.2.11-9ubuntu2.

gcc is version: gcc (GCC) 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)

These are the standard 7.10 distribution packages.

Warnings are treated as errors. Isn't this a setting in the make file?
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: Compile warnings /lib/netplay.c

Post by Per »

You should check your version of SDL_net. Here it has a const pointer in its second argument, which should not give these warnings.
"Make a man a fire, you keep him warm for a day. Set a man on fire, you keep him warm for the rest of his life."
Giel
Regular
Regular
Posts: 725
Joined: 26 Dec 2006, 19:18

Re: Compile warnings /lib/netplay.c

Post by Giel »

R3dP!pe wrote: Warnings are treated as errors. Isn't this a setting in the make file?
Actually it's an option you can give to the configure script. Try running configure with --enable-debug=relaxed to allow warzone to compile with warnings.
"First make sure it works good, only then make it look good." -- Giel
Want to tip/donate? bitcoin:1EaqP4ZPMvUffazTxm7stoduhprzeabeFh