Skip to content

Commit 1ff179d

Browse files
committed
Fix Kerberos build on Alpine 3.23+ (GCC 15/C23)
Alpine 3.23 ships with GCC 15, which uses C23 as the default language standard. In C23, empty parentheses `()` in function declarations mean "no arguments" (like C++) instead of "unspecified arguments" (C17 and earlier). Several dependencies (MIT Kerberos 1.21.3, Cyrus SASL 2.1.28) use old-style K&R declarations that conflict with proper prototypes, causing build errors like: error: conflicting types for 'ss_delete_info_dir'; have 'void(void)' error: too many arguments to function 'MD5_memcpy'; expected 0 This fix adds -std=gnu17 globally in setup_musl_compiler() to force C17 semantics for all dependency builds. This is fully backwards compatible since GCC 8-14 already used gnu17 as the default.
1 parent de06b7d commit 1ff179d

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

ext/build_linux_x86_64_musl.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,17 @@ Or install individually as needed."
135135
setup_musl_compiler() {
136136
# musl-specific compiler flags
137137
export CC="gcc"
138-
export CFLAGS="-fPIC -O2 -static-libgcc"
139-
export CXXFLAGS="-fPIC -O2 -static-libgcc"
138+
# GCC 15+ (Alpine 3.23+) uses C23 by default, where empty parentheses ()
139+
# mean "no arguments" instead of "unspecified arguments". Several dependencies
140+
# (MIT Kerberos, Cyrus SASL) use old-style K&R declarations incompatible with C23.
141+
# Force C17 standard globally for all dependency builds.
142+
# This is backwards compatible: GCC 8-14 used gnu17 as default anyway.
143+
export CFLAGS="-fPIC -O2 -static-libgcc -std=gnu17"
144+
export CXXFLAGS="-fPIC -O2 -static-libgcc"
140145
export CPPFLAGS=""
141146
export LDFLAGS="-static-libgcc"
142147

143-
log "Applied musl-specific compiler flags"
148+
log "Applied musl-specific compiler flags (with C17 for GCC 15+ compatibility)"
144149
}
145150

146151
# Build OpenSSL for musl

0 commit comments

Comments
 (0)