(void)foo or __unused foo ?

Adrian Chadd adrian at freebsd.org
Fri Jul 27 18:25:23 UTC 2012


I'd rather see a compiler-interpretable "way" of doing this.

You could always just use your own for now, until something comes
along (like how many #define N(a) there are in the tree, until nitems
showed up.)

Ie:

#define A_UNUSED_T    void

(A_UNUSED_T) foo;

That way (a) it's easy to change with a compile macro change, (b) if
it ever clashes, it should be easy enough to rename without having to
risk renaming fields you didn't want to, and (c) it's
compiler-interpretable.

I wonder if bde has any ideas on where a BSD "unused" hint could be stuffed..




Adrian


More information about the freebsd-current mailing list