[crossfire] [PATCH] Crossfire client linking fails in trunk

Tolga Dalman tolga.dalman at googlemail.com
Mon Aug 11 14:16:36 CDT 2014


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 08/11/2014 04:24 PM, Kevin Zheng wrote:
> On 08/11/2014 06:24, Tolga Dalman wrote:
>> the attached patch fixes the client compilation on trunk. Thanks!
> 
> Committed in r19602 with minor changes, thanks!

Great!


> Have you tried the CMake build system? I intend to support both Autotools
> and CMake for the next release, but start to phase out the former in the
> distant future.

CMake is definitely the way to go. Unfortunately, it doesn't yet work
as expected.

[  7%] Building C object common/CMakeFiles/cfclient.dir/client.c.o
/home/tdalman/src/crossfire/client/trunk/common/client.c: In function
'init_connection':
/home/tdalman/src/crossfire/client/trunk/common/client.c:344:21: error:
storage size of 'hints' isn't known
     struct addrinfo hints;
                     ^

A quick analysis shows the reason explained here:

https://stackoverflow.com/questions/12024703/why-cant-getaddrinfo-be-found-when-compiling-with-gcc-and-std-c99

Naturally, I would compile with -std=gnu99, but that's not a portable
solution :)


/home/tdalman/src/crossfire/client/trunk/common/client.c:497:5: warning:
implicit declaration of function 'freeaddrinfo' [-Wimplicit-function-declaration]
     freeaddrinfo(res);
     ^

Don't know, what this is. Probably a follow-up error from above.
I also noticed that <sys/types.h> is not included first in this file - this
could lead to further errors.


/home/tdalman/src/crossfire/client/trunk/common/client.c: In function
'negotiate_connection':
/home/tdalman/src/crossfire/client/trunk/common/client.c:578:9: warning:
implicit declaration of function 'usleep' [-Wimplicit-function-declaration]
         usleep(10*1000);    /* 10 milliseconds */
         ^

<unistd.h> is not included.


Best regards
Tolga Dalman



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBAgAGBQJT6RaUAAoJEATLYSm2cxP9QYAH/RkhjqaAPkKPe6fsrHCLukwc
2NCzKgE5tSg31V2bKZ1MSTs9QUoA7nT5W76pl0xkwJEcPvGkxWTUbHsI8y6Q7qqx
BcdqAxpT/lwUaMOjzSLP7KxkFPXEYKCYxm6qDkopMBLT/dK0MvKwohu5EYMPkNcO
nlLaCTfRLN11O4lWT/T7iW/0h11cB2qpLl6u9FkPqZgNBbsiXKeOIFCUrJLiAI6G
yo27jrg/tj1YLbiUKsD3GwA49oUUFswDwteu1g/dRH7t58d/2pImtrSmtWpwN782
pZ5BY+WWcuRmtfR4b2/aPcXsUmFL4RQGnXXLB0NXVrkUXXfmLqwRHCOkdMv20Q4=
=1Q5L
-----END PGP SIGNATURE-----


More information about the crossfire mailing list