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

Arne Schmitz arne.schmitz at gmx.net
Fri Jun 9 15:30:28 CEST 2006


Am Freitag, 9. Juni 2006 11:52 schrieb Ben Batt:
> Hi,
> Just my 2 cents:
>
> On 5/31/06, Ken Hughes <khughes at pacific.edu> wrote:
> > But the problem is we (well, I anyway) don't want to just shut up all
> > the warnings, but only the ones we know are OK.  We want the complaint
> > to show up when it's an unintentional unused parameter.
> >
> > If there's no way to do that with msvc, oh well, but if we can do
> > something for gcc then at least those of us using it can detect when
> > there is a problem.
>
> I agree, those warnings are quite annoying. I asked about this once
> before, but I'm pretty new to Blender development, and it didn't seem
> like anyone else thought it was worthwhile. It'd be great to have a
> gcc macro, and it's pretty simple:

What I usually do to indicate an unused variable is:

int f(int unused_arg)
{
   /* Unused arguments: */
   (void)unused_arg;
   ...
}

This is valid C and C++, plus it is portable across all platforms.

Arne

-- 
Dipl.-Inform. Arne Schmitz              Phone   +49 (0)241 80-21817
Computer Graphics Group                 Fax     +49 (0)241 80-22899
RWTH Aachen University                  http://www.rwth-graphics.de
Ahornstrasse 55, 52074 Aachen, Germany
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://projects.blender.org/pipermail/bf-committers/attachments/20060609/849f3018/attachment.pgp


More information about the Bf-committers mailing list