[PATCH] resolv, rt: Change some extern inline functions to static inline
Peter Collingbourne
pcc@google.com
Mon May 4 17:51:12 GMT 2026
On Mon, May 4, 2026 at 6:34 AM Florian Weimer <fweimer@redhat.com> wrote:
>
> * Cristian Rodriguez:
>
> > On Fri, May 1, 2026 at 12:43 PM Peter Collingbourne <pcc@google.com> wrote:
> >>
> >> On Fri, May 1, 2026 at 1:39 AM Florian Weimer <fw@deneb.enyo.de> wrote:
> >> >
> >> > * Peter Collingbourne:
> >> >
> >> > > The following functions:
> >> > >
> >> > > __aio_create_helper_thread
> >> > > __aio_start_notify_thread
> >> > > __gai_create_helper_thread
> >> > > __gai_start_notify_thread
> >> > >
> >> > > are declared as extern inline, but no translation unit provides their
> >> > > real definitions. This can lead to a link failure if the functions are
> >> > > not inlined. Fix it by declaring them as static inline instead.
> >> >
> >> > I would drop the “inline” as well, encouraging the compiler to make
> >> > the inlining decision.
> >>
> >> That causes some build failures, e.g.
> >>
> >> In file included from aio_error.c:30:
> >> ../sysdeps/unix/sysv/linux/aio_misc.h:38:1: error: ‘__aio_create_helper_thread’
> >> defined but not used [-Werror=unused-function]
> >> 38 | __aio_create_helper_thread (pthread_t *threadp, void *(*tf) (void *),
> >> | ^~~~~~~~~~~~~~~~~~~~~~~~~~
> >> ../sysdeps/unix/sysv/linux/aio_misc.h:29:1: error: ‘__aio_start_notify_thread’ d
> >> efined but not used [-Werror=unused-function]
> >> 29 | __aio_start_notify_thread (void)
> >> | ^~~~~~~~~~~~~~~~~~~~~~~~~
> >
> >
> > So, they need a __attribute_maybe_unused__ annotation.
>
> Peter, could you post a v2 with this additional change?
Setting aside whether it's really worth trying to encourage these
functions to be inlined (they start threads, which is expensive
anyway), "static inline __always_inline" seems like a better
expression of our intent, so I did that in v2.
Peter
More information about the Libc-alpha
mailing list