Dan Sugalski <dan@sidhe.org> writes:
> So, I'm turning off the unused parameter warning for now to shut the
> .ops file compiles up. After that point, all submitted patches must
> generate no more warnings than were currently being generated, and all
> submitted patches must *not* generate warnings in the areas they patch.
The warnings about unused variables quickly become useful again if you're
willing to tag things with __attribute__((__unused__)) (generally wrapped
in a convenient macro).
I use:
/* __attribute__ is available in gcc 2.5 and later, but only with gcc 2.7
could you use the __format__ form of the attributes, which is what we use
(to avoid confusion with other macros). */
#ifndef __attribute__
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
# define __attribute__(spec) /* empty */
# endif
#endif
/* Used for unused parameters to silence gcc warnings. */
#define UNUSED __attribute__((__unused__))
and then writing things like:
int
foo(int bar UNUSED)
actually serves to add additional documentation as well as shutting up
warnings.
--
Russ Allbery (rra@stanford.edu) <http://www.eyrie.org/~eagle/>
Thread Previous
|
Thread Next