Repository navigation
test: test_inplace_body_only 显式声明 _POSIX_C_SOURCE(修 tag 上 CI 红) - #70
Merged
Merged
Conversation
该测试原先用 mkdtemp 建临时目录。mkdtemp 属 POSIX/BSD 命名空间,本仓 CMAKE_C_EXTENSIONS OFF(严格 C11),glibc 下补 _POSIX_C_SOURCE 即可; macOS 上试过 _POSIX_C_SOURCE / _DARWIN_C_SOURCE / _GNU_SOURCE 三种宏均未生效 (原因未查明,同目录 test_art_alignment.c 用 _GNU_SOURCE + mkdtemp 能编过, 行为不一致)。 改为用 <time.h> 的 time() + 静态计数拼接唯一 shm 路径,只依赖 C 标准库; shm 后端自己创建文件,无需预先建目录。修复 v0.3.30 tag 上 ci / ci-macos 的红。 Co-Authored-By: Claude Code <noreply@anthropic.com>
miaobyte
force-pushed
the
fix/posix-source-mkdtemp
branch
from
November 2, 2026 01:32
145044c to
3b4a333
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
修 v0.3.30 tag 上
ci/ci-macos的红色:test_inplace_body_only.c依赖mkdtemp。现象
mkdtemp属 POSIX/BSD;本仓CMakeLists.txt设CMAKE_C_EXTENSIONS OFF(严格 C11),CI 的 gcc 报隐式声明。本机 glibc 默认放开该符号,所以本地
ctest 12/12全绿也发现不了。四次迭代(如实记录)
#define _POSIX_C_SOURCE 200809L__APPLE__→_DARWIN_C_SOURCE,其余_POSIX_C_SOURCE_GNU_SOURCEmkdtemp依赖(本 PR)重要:我们没能查明 1–3 为何在 macOS 上不生效。 同目录
test_art_alignment.c用
_GNU_SOURCE+mkdtemp在 macOS CI 上是能编过的,行为不一致;对比过include 顺序(宏均在所有系统头之前),也排除不了这个矛盾。因此本 PR 不再依赖任何
特性宏,改为只用 C 标准库——结论写进了代码注释,不做未经证实的归因。
改动
shm 后端自己创建文件,无需预先建目录。
验证
gcc -std=c11 -fsyntax-only通过ci与ci-macos在145044c上均 success(本 PR 的上一版已跑绿;本次仅新增代码注释,仍需本次 run 确认)
🤖 Generated with Claude Code