Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン 初心者向け
#1,775 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@facelessdevhack がすでに取り組んでいます。

2026年10月15日 から。

  • #1799 @facelessdevhack による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
c
領域
build-system

調査の方向性

アマルガメーションビルドから始めます。make amalgamation を実行し、次に build/eigenscript_all.c を gcc -Wall -Wextra -O0 -c と -O1 でコンパイルして警告を再現します。-Wreturn-type の警告は builtin_tensor_gather を指しており、この関数は ARG_GUARD(1, ...) で終わっているため、raise の後に明示的な return を追加してください。-Wmaybe-uninitialized の警告は vm_run_ex の _ad/_bd と vm_index_resolve のインデックス i に関するもので、宣言箇所で初期化してください。両方のビルドが warning: の行を出力せず、make embed-smoke がそれを保証すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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.
主要言語
C
スター
3
フォーク
7
平均マージ
8時間 43分
マージ済み PR(30日)
253

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

InauguralSystems/EigenScript のほかの issue

InauguralSystems/EigenScript の issue をすべて見る

似ている issue

C の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。