fix(cl): handle plain char on unsigned-char targets
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
- 55/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Lĩnh vực
- build-system, tooling
Hướng nghiên cứu
Start with the C type mapping and macro argument generation implicated by the CXType_Char_U versus CXType_UChar distinction. Reproduce on Linux arm64 with the stated CI command, then compare generated output for cl/_testc/function and the cl/_testc/macrofn_auto/in.h fixture. Done means plain char bindings and forwarding macro string arguments generate successfully with behavior that respects target char signedness.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
On Linux arm64, Clang reports plain C char as CXType_Char_U. llcppg currently maps Char_U and explicit unsigned char (CXType_UChar) together to Go uint8. This makes ordinary char * bindings incompatible with c.Str, which returns *c.Char.
Reproduction
On Linux arm64, run the existing CI command:
llgo test -v -coverpkg=./... -covermode=atomic -coverprofile=coverage.txt ./...
The existing cl/_testc/macrofn_auto/in.h fixture contains this forwarding macro:
#define ZLIB_VERSION "1.3.1"
int deflateInit_(z_streamp strm, int level, const char *version, int stream_size);
#define z_deflateInit(strm, level) \
deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream))
Actual behavior
The const char *version parameter is mapped to *uint8, but the automatically generated macro call passes c.Str("1.3.1"), whose type is *c.Char. Generation panics because *c.Char cannot be passed as *uint8.
The generated output also differs from the existing fixtures for ordinary char * declarations. For example, cl/_testc/function produces Xprintf(fmt *uint8, ...) while the expected output uses *c.Char.
Expected behavior
Plain char bindings and string arguments in forwarding macros should work on Linux arm64 without a generation panic. Handling should account for the distinction between plain char and explicit unsigned char, as well as the target's char signedness.
Environment and evidence
Reproduced on Ubuntu 24.04 arm64 with LLVM 22, LLGo 1.0.8, Go 1.27.0, and github.com/goplus/lib v0.7.1, based on main commit b36e6307e67751c67654da37297ab654ef0ef0e3. The Linux arm64 job added in #1149 reproduces the failure: https://github.com/goplus/llcppg/actions/runs/42154256948/job/127684520612
- Ngôn ngữ chính
- Go
- Star
- 40
- Fork
- 13
- Merge trung bình
- 2 giờ 44 phút
- Pull request đã merge (30 ngày)
- 112
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
-
feature proposal
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
Maintainer thường phản hồi trong vòng 1 ngày
-
proposal
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 28/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 64/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
goplus/llcppg#1136 · 1 bình luận ·
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ự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
[FEATURE]: Set fieldPath and reason on the CEL validation rulesCó thể đã có người làm @bjosv đã nhận hôm nay. Đang mởenhancement needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
valkey-io/valkey-operator#618 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
agent-butler-finding bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
jordansmall/spindrift#6414 ·
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 68/100
Icinga/icinga-kubernetes#294 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
Cluster details: the Control Plane version field has a different border color than its icon boxĐang mởkind/design sig/ui
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
kubermatic/dashboard#8449 ·
Maintainer thường phản hồi trong vòng 1 ngày