-Wunused-parameter is implied by "-Wall -Wunused" and "-Wextra" but not plain "-Wall" (which is the autotools default).
The #pragma unused invocation is not too ugly and has the advantage of being ignored by any compiler that does not support it.
There is also attribute((unused)) but that's not only long and ugly, but also only supported by gcc I think.
One could also say that if doxygen is used with code that does not declare functions separately, unused variables cannot be avoided in a portable way, so that warnings about such should just be ignored/disabled.
One could also say that if doxygen is used with code that does not declare functions separately, unused variables cannot be avoided in a portable way, so that warnings about such should just be ignored/disabled.
In other words (for gcc): Whoever uses -Wunused (be that directly or through -Wextra) should pass -Wno-unused-parameter as well.
I agree with Markus, that we want to document the parameters. I see two possible ways:
use the void cast
... kind of ugly, but it works
... might be made a bit more readable with the "#define UNUSED_ARGUMENT(x) (void)x", as suggested on the webpage Markus mentioned.
use something like
void foo(int UNUSED_ARG(bar))
where UNUSED_ARG might be defined to different things, when compiling, or when using doxygen.
For doxygen we would define something like "#define UNUSED_ARG(x) x",
whereas the normal dune code would contain a definition like "#define UNUSED_ARGUMENT(x)"
or "#define UNUSED_ARG(x) UNUSED_ ## x attribute((unused))" if attribute unused is supported.
How about this: file a wishlist bug for doxygen to allow to document parameters based on the number a parameter has in the list. Then apply Elias' patches (now or later).
If one has to provide an extra option besides -Wall, there is no need to clutter the code and make it more unreadable than it already is.
Therefore we should definitely leave it as it is.