https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104633
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> --- The following is a valid use of extern inline I think extern int memcmp (const void * p, const void *q, unsigned long size); extern inline __attribute__((always_inline,gnu_inline)) int memcmp (const void * p, const void *q, unsigned long size) { return memcmp (p, q, size); } int foo (const void * p, const void *q) { return memcmp (p, q, 4); } I think the user needs to avoid name-lookup issues here by using an alias for the call to memcmp in the inline wrapper which might also avoid the diagnostic. That __builtin_memcmp finds the memcmp definition is quite unfortunate and makes it not usable as a way to avoid using an alias.