Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Amalgamation compiles with warnings at -O0 (-Wreturn-type) and -O1 (-Wmaybe-uninitialized)

Đang mở Phù hợp với người mới
#1,775 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@facelessdevhack đang làm issue này rồi.

Từ ngày 15/10/2026.

  • #1799 của @facelessdevhack — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
72/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
c
Lĩnh vực
build-system

Hướng nghiên cứu

Bắt đầu với bản build amalgamation: chạy make amalgamation, sau đó biên dịch build/eigenscript_all.c bằng gcc -Wall -Wextra -O0 -c và -O1 để tái hiện các cảnh báo. Cảnh báo -Wreturn-type trỏ tới builtin_tensor_gather, hàm này kết thúc bằng ARG_GUARD(1, ...); hãy thêm một return tường minh sau raise. Các cảnh báo -Wmaybe-uninitialized liên quan đến _ad/_bd trong vm_run_ex và chỉ số i trong vm_index_resolve; hãy khởi tạo chúng ngay tại nơi khai báo. Hoàn thành khi cả hai bản build đều không in dòng warning: nào và make embed-smoke bảo vệ điều này.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

area:embed bug found-by:code-review

Finding

The release build (make, -O2) is warning-free, but the shipped single-file amalgamation (make amalgamation, build/eigenscript_all.c, the "copy two files" embed path, #397) is not at the other usual optimisation levels. Measured on main 0740af03 with gcc -Wall -Wextra $(cat tools/werror_flags.txt) -c build/eigenscript_all.c:

  • -O0 (the usual embedder debug build): 1 warning, builtin_tensor_gather: control reaches end of non-void function [-Wreturn-type]. The function ends in ARG_GUARD(1, ...), whose constant condition -O0 does not fold.
  • -O1: 7 warnings, all -Wmaybe-uninitialized:
    • 5 x _ad, reached through num_to_i64_exact, inlined into vm_run_ex. The bitwise arms read _ad after slot_as_double(_as, &_ad) & slot_as_double(_bs, &_bd), which sets it only on success.
    • 2 x i, reached through vm_index_resolve, inlined into jit_helper_index_set.

All are false positives by inspection, but an embedder compiling eigenscript_all.c with -Wall at -O0 or -O1 gets them. Found while building #1758's C slot test against the amalgamation, which now compiles with the release flags to avoid them.

Done when

  • After make amalgamation, gcc -Wall -Wextra $(cat tools/werror_flags.txt) -O0 -c build/eigenscript_all.c and the same with -O1 print no warning: line (paste both counts in the PR).
  • builtin_tensor_gather ends in a statement the compiler can see returns at every level, for example the raise followed by an explicit return. _ad/_bd and the index i are initialised where they are declared.
  • A check keeps it that way. For example, make embed-smoke also compiles the amalgamation at -O0 -Wall -Wextra and greps the output for warning:. Planted fault: removing the return again turns it red.
Ngôn ngữ chính
C
Star
3
Fork
7
Merge trung bình
8 giờ 41 phút
Pull request đã merge (30 ngày)
254

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của InauguralSystems/EigenScript

Tất cả issue của InauguralSystems/EigenScript

Issue tương tự

Thêm issue về C

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.