Summary
Fix build failure on Alpine Linux (musl libc) due to use of non-portable type.
Problem
When compiling Gloo on Alpine Linux (which uses musl libc), the build fails in gloo/common/linux.cc due to the use of __caddr_t:
ifr->ifr_data = (__caddr_t)&ecmd;
ifr->ifr_data = (__caddr_t)&edata;
__caddr_t is not portable and causes issues on musl-based systems.
Proposed fix
Replace __caddr_t with char*, which is compatible across libc implementations:
ifr->ifr_data = (char*)&ecmd;
ifr->ifr_data = (char*)&edata;
Notes
This change allows successful compilation on Alpine Linux without affecting behavior on glibc-based systems.
This change does not break compatibility either; it is a subtle change that does not alter how Glibc performs the operation.
__caddr_t is effectively an alias for char* on glibc-based systems, so replacing it with char* preserves behavior while improving portability.
Summary
Fix build failure on Alpine Linux (musl libc) due to use of non-portable type.
Problem
When compiling Gloo on Alpine Linux (which uses musl libc), the build fails in
gloo/common/linux.ccdue to the use of__caddr_t:__caddr_tis not portable and causes issues on musl-based systems.Proposed fix
Replace __caddr_t with char*, which is compatible across libc implementations:
Notes
This change allows successful compilation on Alpine Linux without affecting behavior on glibc-based systems.
This change does not break compatibility either; it is a subtle change that does not alter how Glibc performs the operation.
__caddr_tis effectively an alias forchar*on glibc-based systems, so replacing it withchar*preserves behavior while improving portability.