fix(cl): temporary cglm macro redefinitions emit duplicate Go constants
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
Start in cl/preprocessor.go, in loadMacro, where repeated macro values are tolerated but a new constant is otherwise emitted. Reproduce by running llcppg over the cglm include tree, focusing on include/cglm/io.h where m and n are defined, undefined and redefined. Done when the cglm generation no longer panics with M redeclared and the macro handling is consistent for undefined and redefined macros.
由索引模型根据 Issue 内容生成。
描述
Observed failure
The cglm recursive installed-header generation panics because the temporary C macro m is emitted twice as Go constant M with different values.
panic: .../include/cglm/io.h:168:9: M redeclared in this block
previous declaration at .../include/cglm/io.h:125:9
.../cl/preprocessor.go:88
Confirmed Linux amd64 job, from migration PR #43. The Linux arm64 job in the same run also has the same generation failure. Formula testing, input preparation, and the LLGo/llcppg builds passed; macOS jobs were still pending when this report was prepared.
Input and versions
- llcppg:
8fc0f987e41ffe4b4f608e9541422b460ea89fea; LLGo:afe9a5407260348b18c7104e98d76cb5cdf48b29; LLVM 21. - Actual source: recp/cglm
v0.9.6, commit 144d1e7c29b3b0c6dede7917a0476cc95248559c, not the Formula's older floor tag. - Failed index head:
8a37735.
{
"Name": "cglm",
"Language": "c",
"Dir": "./include/...",
"FuncPrefix": ["glm_"],
"LLGoPackage": "link: $(pkg-config --libs cglm)"
}
The CI stages the entire installed include tree, initializes the source Go module, and runs llcppg -v ./generated ./source without a Files allowlist.
Macro sequence
In include/cglm/io.h, the matrix-print helpers use this legal define/undef/redefine sequence inside their function bodies:
#define m 4
#define n 4
/* first helper body */
#undef m
#undef n
/* later helper */
#define m 3
#define n 3
The source uses lowercase m; the diagnostic names its generated uppercase Go constant M. This sequence is not two simultaneously active C definitions. Source inspection shows cl/preprocessor.go is unchanged between the CI pin and main aab6dbf0baedc47b42f9576a65dd79ce6715e31a: loadMacro tolerates a repeated value but otherwise emits a new constant. Latest main has not been executed for this report.
The same generation log has earlier diagnostics for undeclared glms_aabb2d_size and missing ../common.h in the handed quaternion headers. Their origin has not been established, and this issue does not claim the macro failure explains those diagnostics.
Expected behavior
Handle temporary/undefined/redefined macros consistently instead of creating colliding top-level Go declarations and panicking. No MacroIgnore, header exclusions, or native-header changes have been applied to hide the failure.
- 主要语言
- Go
- 星标
- 39
- 派生
- 13
- 平均合并
- 1 小时 28 分钟
- 30 天内合并 PR
- 256
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
goplus/llcppg 的其他 Issue
-
bug
难度 5/5 一周以上 新手友好度 28/100
维护者通常 1 天内回复
-
bug
难度 4/5 3-5 天 新手友好度 55/100
维护者通常 1 天内回复
-
feature proposal
难度 5/5 一周以上 新手友好度 18/100
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 25/100
维护者通常 1 天内回复
-
Architecture-Design feature to be confirm
难度 5/5 一周以上 新手友好度 35/100
维护者通常 1 天内回复
相似的 Issue
-
area/import kind/bug
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
kind/documentation
难度 2/5 1-3 小时 新手友好度 80/100
kubernetes-sigs/dra-driver-nvidia-gpu#1569 ·
维护者通常 1 天内回复
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P2
难度 2/5 1-3 小时 新手友好度 65/100
openclaw/openclaw-enterprise#2571 · 1 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
难度 1/5 1-3 小时 新手友好度 72/100
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复