]> git.ozlabs.org Git - ccan/commitdiff
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)
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>

No differences found