Description of problem: On musl libc *strerror_r* defined to return int even with _GNU_SOURCE: ``` /* /usr/include/string.h */ #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \ || defined(_BSD_SOURCE) // ... int strerror_r (int, char *, size_t); // ... ``` this causes compilation error: ``` lvmpolld-core.c:56:9: error: incompatible integer to pointer conversion returning 'int' from a function with result type 'const char *' [-Wint-conversion] return strerror_r(errnum, data->buf, sizeof(data->buf)); /* never returns NULL */ ``` Version-Release number of selected component (if applicable): 2.03.14 How reproducible: Always Steps to Reproduce: Try to build on musl libc Expected results: Successful build
Hmmm - seems like testing condition for _GNU_SOURCE could be improved and checked better if the system actually provides symbol in right variant. It's worth to note lvm2 project is only supported for glibc - that fact it mostly works with i.e. 'musl C library' is mostly due to support from users using it - i.e. we can apply patches - however we do not have any system with such library present.
Upstream patch: https://listman.redhat.com/archives/lvm-devel/2022-November/024479.html