Re: Switch -Wunused-variable on?

Jan Kratochvil
2012-04-23T08:55:27Z

On Mon, 23 Apr 2012 00:25:36 +0200, Jeffrey Walton wrote:
> On Sun, Apr 22, 2012 at 4:24 PM, Sergio Durigan Junior <sergiodj@redhat.com> wrote:
> > Yes, this is a counter-argument, and I was also thinking about it. Â I
> > don't know how people prefer to deal with this issue,

I would find right to properly #if-compile even the variable declaration but
I do not have real experience how complicated it may be.

> > #define USED_VAR(var) ((void) var)
>
> I use this technique when using -Wall. It even works on Visual Studio,
> so the technique is portable.

Sourceware is using ATTRIBUTE_UNUSED.

Thanks,
Jan