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

Stephen Swaney sswaney at centurytel.net
Sat May 27 19:55:49 CEST 2006


On Sat, May 27, 2006 at 07:26:51AM -0700, Ken Hughes wrote:
> I'm getting annoyed by all these warnings for "unused parameters", 
> mainly in the Python code.  

The unused param warnings *are* a little annoying.  My solution was to
save the build output to a log and and then use grep -v to remove
all things I don't care about.

For reasons I can not quite put my finger on, setting  self = NULL;
strikes me somehow as lame.  It does, however, have the advantage of
working everyewhere.

> Can we discuss and arrive at some solution for this?  If nothing else, 
> maybe I'll pick a nice, general-purpose *.h file and add:
> 
> #if defined (__linux__)
> #define UNUSED(x) x __attribute__ ((unused))
> #else
> #define UNUSED(x) x
> #endif

GCC defines a __GNUC__ macro.  Maybe that could be used to key off of
since gcc is also used on platforms besides linux.

-- 
Stephen Swaney			
sswaney at centurytel.net



More information about the Bf-committers mailing list