[Bf-committers] Re: Solution for suppressing "unused parameter"warnings?

Ben Batt benbatt at gmail.com
Fri Jun 9 16:21:30 CEST 2006


Hi,

On 6/9/06, Arne Schmitz <arne.schmitz at gmx.net> wrote:
> What I usually do to indicate an unused variable is:
>
> int f(int unused_arg)
> {
>    /* Unused arguments: */
>    (void)unused_arg;
>    ...
> }

I suggested something like this once, but it wasn't very popular. The
people who I talked to basically said it wasn't good coding style, and
I guess I can see their point: It puts a whole bunch of unnecessary
(and possibly confusing) statements in just to suppress some warnings,
which tends to obfuscate the code a bit.

I've never actually used this convention, do you use it much?

Ben


More information about the Bf-committers mailing list