Errors compiling tmw-eA server

Ask for help regarding any technical issue or report any bug or OS independent issues.
Post Reply
Frost
TMW Adviser
TMW Adviser
Posts: 851
Joined: 09 Sep 2010, 06:20
Location: California, USA

Errors compiling tmw-eA server

Post by Frost »

I've been running a small server for a few months. I try to keep it up to date with the latest content and server code from gitorious. Recently, I stopped being able to compile the server binaries.

Server is CentOS 5.6 with all the latest updates. I've attached a log showing the problem and some information about my system. What am I doing wrong?
Attachments
tA compile errors.txt
(8.17 KiB) Downloaded 103 times
You earn respect by how you live, not by what you demand.
-unknown
User avatar
o11c
Grand Knight
Grand Knight
Posts: 2262
Joined: 20 Feb 2011, 21:09
Location: ^ ^

Re: Errors compiling tmw-eA server

Post by o11c »

Frost's log wrote: src/map/magic-stmt.c:68: error: redefinition of parameter ‘unused___COUNTER__’
src/map/magic-stmt.c:68: error: previous definition of ‘unused___COUNTER__’ was here
__COUNTER__ is a builtin macro introduced in GCC 4.3. Note that GCC 4.3 is also the oldest version that can build the latest mana client, although the consensus in #mana seemed to be that it would be fine to require 4.4.

Looking at the definition:

Code: Select all

src/common/sanity.h-24-/// A name for unused function arguments - can be repeated
src/common/sanity.h:25:# define UNUSED UNUSED_IMPL(__COUNTER__)
src/common/sanity.h-26-// Don't you just love the hoops the preprocessor makes you go through?
src/common/sanity.h:27:#  define UNUSED_IMPL(arg) UNUSED_IMPL2(arg)
src/common/sanity.h:28:#  define UNUSED_IMPL2(suffix) unused_ ## suffix __attribute__((unused))
and the only time it gets used multiple times on one line:

Code: Select all

src/map/magic-stmt.c-67-static void
src/map/magic-stmt.c:68:invocation_timer_callback (timer_id UNUSED, tick_t UNUSED, custom_id_t id, custom_data_t data)
src/map/magic-stmt.c-69-{
--
src/map/magic-stmt.c-225-
src/map/magic-stmt.c:226:static void timer_callback_effect (timer_id UNUSED, tick_t UNUSED, custom_id_t id, custom_data_t data)
src/map/magic-stmt.c-227-{
These could be changed locally to UNUSED_IMPL(1), UNUSED_IMPL(2). If there are any cases where UNUSED function arguments wrap lines, you could change __COUNTER__ to __LINE__.

I oppose actually making these changes in the source repository, though, since even 4.3 is a pretty old release of GCC, and it's not necessary for the main server.

The relevant files are believed not to be touched until after more major changes that require a higher GCC version - I probably won't be making this kind of release again.

(Note also that my latest version of the server is in C++, which allows you to omit the name of a function parameter entirely, so the UNUSED macro has since been removed.)
Former programmer for the TMWA server.
Frost
TMW Adviser
TMW Adviser
Posts: 851
Joined: 09 Sep 2010, 06:20
Location: California, USA

Re: Errors compiling tmw-eA server

Post by Frost »

Thank you, o11c. Based on your post, I installed CentOS 6.0, which has GCC 4.4.4.

I am now able to compile the tA server according to the instructions at http://wiki.themanaworld.org/index.php/How_to_Develop
You earn respect by how you live, not by what you demand.
-unknown
Post Reply