Switch -Wunused-variable on?

Jan Kratochvil jan.kratochvil@redhat.com
Mon Apr 23 08:55:00 GMT 2012


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



More information about the Gdb mailing list