This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Switch -Wunused-variable on?
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