Hi,
On 2021-10-25 13:58:06 -0400, Tom Lane wrote:
> Andres Freund <andres@anarazel.de> writes:
> >> Seems like we need a less quick-and-dirty approach to dealing with
> >> unnecessary simplehash support functions.
>
> > I don't think the problem is unnecessary ones?
>
> I was thinking about the stuff like SH_ITERATE, which you might or
> might not have use for in any particular file. In the case at hand
> here, a file that doesn't call SH_INSERT would be at risk of getting
> unused-function complaints about SH_GROW. But as you say, if we do
> find that happening, __attribute__((unused)) would probably be
> enough to silence it.
I was hoping that a reference from a static inline function ought to be
sufficient to prevent warning about an unused-static-not-inline function, even
if the referencing static inline function is unused... It does work that way
with at least the last few versions of gcc (tested 8-11) and clang (tested 6.0
to 13).
Greetings,
Andres Freund