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>
Showing
Please register or sign in to comment