From 359f9b26ef325b57fa4be788f020e2a6f3b69da5 Mon Sep 17 00:00:00 2001 From: auronandace Date: Mon, 8 Jun 2026 10:32:22 +0100 Subject: [PATCH] verify stdlib header includes --- src/header/stdlib/cbindgen.toml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/header/stdlib/cbindgen.toml b/src/header/stdlib/cbindgen.toml index c105da5486..42614be7d7 100644 --- a/src/header/stdlib/cbindgen.toml +++ b/src/header/stdlib/cbindgen.toml @@ -1,4 +1,18 @@ -sys_includes = ["stddef.h", "alloca.h", "wchar.h", "features.h"] +# POSIX header spec: https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/stdlib.h.html +# +# Spec quotations relating to includes: +# - "The header shall define NULL as described in ." +# - "size_t As described in ." +# - "wchar_t As described in ." +# - "In addition, the header shall define the following symbolic constants and macros as described in : WCOREDUMP, WEXITSTATUS, WIFEXITED, WIFSIGNALED, WIFSTOPPED, WNOHANG, WSTOPSIG, WTERMSIG, WUNTRACED" +# - "The header shall define the following symbolic constants as described in : O_APPEND, O_CLOEXEC, O_CLOFORK, O_DSYNC, O_NOCTTY, O_RDWR, O_RSYNC, O_SYNC" +# - "Inclusion of the header may also make visible all symbols from , , , , and ." +# +# POSIX allows inclusion of stdint.h via: fcntl.h > unistd.h > stdint.h (our fcntl.h doesn't include unistd.h so just include stdint.h here directly instead) +# stdint.h needed for unintptr_t for __stack_chk_guard +# sys/wait.h brings in signal.h which brings in features.h +# features required for deprecated and no return annotations +sys_includes = ["stddef.h", "sys/wait.h", "fcntl.h", "stdint.h"] include_guard = "_RELIBC_STDLIB_H" trailer = """ #ifndef _RELIBC_STDLIB_EXTRA_H