New comment by oreo639 on void-packages repository https://github.com/void-linux/void-packages/issues/46959#issuecomment-1786455944 Comment: > So, we move `basename` to `#ifdef __cplusplus`? It would be `#ifndef`, which is already the case and also not this issue. The issue here is that C23 removed support for the original pre-ANSI k&r style function declarations/definitions and `int func()` was made from meaning an old k&r style declaration to being equivalent to `int func(void)` just like how it has been in C++. The idea in musl, is that they declare it using k&r style in `string.h` so that it would be available for glibc compatibility while not breaking applications that re-declare `basename()`, while having the proper definition in `libgen.h`. In C17, this is fine. In C23, they become conflicting declarations. The proper workaround here would smth like: ``` #if !defined(__cplusplus) && !(defined(__STDC_VERSION__) && __STDC_VERSION__ > 201710L) char *basename(); #endif ``` Although this should probably be dealt with upstream before we patch it. (and the final C23 standard will not be published until earlier next year)