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.)