Skip to content

Commit 3dcb996

Browse files
maennchenclaude
andcommitted
Define _DEFAULT_SOURCE when compiling the port driver
With -std=c17, musl's string.h hides the POSIX.1-2008 strnlen declaration, and GCC 14 (Alpine 3.24) turns the resulting implicit declaration into a hard error. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 94a4099 commit 3dcb996

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

c_src/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ ifneq ($(CROSSCOMPILER),)
9494
CC = $(CROSSCOMPILER)gcc
9595
endif
9696

97+
# Expose POSIX.1-2008 declarations (e.g. strnlen) despite -std=c17.
98+
CPPFLAGS += -D_DEFAULT_SOURCE
99+
97100
CFLAGS += -I"$(ERTS_INCLUDE_DIR)" -I"$(ERL_INTERFACE_INCLUDE_DIR)" -I"$(LIBSODIUM_INCLUDE_DIR)"
98101
CXXFLAGS += -I"$(ERTS_INCLUDE_DIR)" -I"$(ERL_INTERFACE_INCLUDE_DIR)" -I"$(LIBSODIUM_INCLUDE_DIR)"
99102

0 commit comments

Comments
 (0)