]> git.ozlabs.org Git - ccan/commit
htable: Mark functions constructed by HTABLE_DEFINE_TYPE as UNNEEDED
authorDavid Gibson <david@gibson.dropbear.id.au>
Wed, 27 Jan 2016 13:06:02 +0000 (00:06 +1100)
committerDavid Gibson <david@gibson.dropbear.id.au>
Tue, 2 Feb 2016 12:00:06 +0000 (23:00 +1100)
commit71b4e3ad90db6bacc51552438c3f6eb2a20d2631
treec67b1f54069ced43a8ada4f1076018ee826e72cf
parentab244401cdba4513f3a3064c5f403fc2a59bf017
htable: Mark functions constructed by HTABLE_DEFINE_TYPE as UNNEEDED

The HTABLE_DEFINE_TYPE macro builds a type-specific hash table by
constructing a bunch of simple wrapper functions.  The user of the hash
table may not end up using all of these.  With gcc the fact that the
functions are inline stops an warnings about unused functions, but that's
not the case with clang.

Suppress these warnings by marking all the constructed functions except
for name##_add() as UNNEEDED (using the macro from ccan/compiler).  _add
is left alone on the grounds that a hash table you never add anything to
isn't much use, so this will help you to spot an entirely redundant
HTABLE_DEFINE_TYPE invocation.  *_init() would be a more obvious choice,
except that there is both *_init() and *_init_sized() and you only need
to use one of these.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
ccan/htable/htable_type.h