fix(cl): temporary cglm macro redefinitions emit duplicate Go constants
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Go
- Star
- 41
- Fork
- 13
- Merge trung bình
- 2 giờ 17 phút
- Pull request đã merge (30 ngày)
- 178
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của goplus/llcppg
-
Proposal: `MacroFunc` Automatic Detection of Forwarding MacrosCó thể đã có người làm @fennoai đã nhận 1 ngày trước. Đang mởArchitecture-Design configuration feature
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
goplus/llcppg#1109 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Proposal: `Define` — inject constants into the generated packageCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởconfiguration feature proposal
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
goplus/llcppg#1067 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 28/100
goplus/llcppg#1035 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
Maintainer thường phản hồi trong vòng 1 ngày
-
feature proposal
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 18/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của goplus/llcppg
Issue tương tự
-
enhancement runtime:claude
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
FootprintAI/Containarium#3214 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
eugenioenko/ttt#1251 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Handler accepts zero/negative NNCP_MAX_RETRIES and NNCP backoff values, stalling policies or hot-loopingCó thể đã có người làm @NopeCharon đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
nmstate/kubernetes-nmstate#1604 ·
-
reportedBy/community Type/Improvement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
openchoreo/openchoreo#5203 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
Gentleman-Programming/gentle-ai#5807 ·
Maintainer thường phản hồi trong vòng 1 ngày