Re: Avoiding "unused variable" warnings

Roman Zippel (
Sun, 13 Jul 2003 18:45:17 +0200 (CEST)


On 13 Jul 2003, Alan Cox wrote:

> > No need for a macro, just do
> >
> > (void) var_name;
> >
> > It doesn't generate any code, and it shuts up the compiler.
> It may do. The proper gcc thing is attribute unused. Both are dangerous
> as they hide when the variable becomes really unused

Function like macros, which throw away their arguments, can be dangerous.
I had a funny bug like this:


bye, Roman

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at