Amalgamation compiles with warnings at -O0 (-Wreturn-type) and -O1 (-Wmaybe-uninitialized)
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 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 の本文から書いたものです。
説明
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 inARG_GUARD(1, ...), whose constant condition-O0does not fold.-O1: 7 warnings, all-Wmaybe-uninitialized:- 5 x
_ad, reached throughnum_to_i64_exact, inlined intovm_run_ex. The bitwise arms read_adafterslot_as_double(_as, &_ad) & slot_as_double(_bs, &_bd), which sets it only on success. - 2 x
i, reached throughvm_index_resolve, inlined intojit_helper_index_set.
- 5 x
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.cand the same with-O1print nowarning:line (paste both counts in the PR). -
builtin_tensor_gatherends in a statement the compiler can see returns at every level, for example the raise followed by an explicitreturn._ad/_bdand the indexiare initialised where they are declared. - A check keeps it that way. For example,
make embed-smokealso compiles the amalgamation at-O0 -Wall -Wextraand greps the output forwarning:. Planted fault: removing thereturnagain turns it red.
- 主要言語
- C
- スター
- 3
- フォーク
- 7
- 平均マージ
- 8時間 43分
- マージ済み PR(30日)
- 253
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
InauguralSystems/EigenScript のほかの issue
-
area:gates bug good first issue
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
InauguralSystems/EigenScript#1782 ·
メンテナーはふだん 1 日以内に返信
-
eigenscript.h declares 8 observer functions that no longer exist対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンarea:observer enhancement found-by:cold-read good first issue
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
InauguralSystems/EigenScript#1781 ·
メンテナーはふだん 1 日以内に返信
-
UB: (int) cast of a user double outside int range in dispatch / vm_index_is_int / flat_index_atオープンarea:runtime-vm
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
InauguralSystems/EigenScript#1748 ·
メンテナーはふだん 1 日以内に返信
-
scan_int_tokens line/col fields are untested対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンarea:stdlib found-by:critic kind:gate-defect
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
InauguralSystems/EigenScript#1693 ·
メンテナーはふだん 1 日以内に返信
-
area:gfx bug
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
InauguralSystems/EigenScript#1684 ·
メンテナーはふだん 1 日以内に返信
InauguralSystems/EigenScript の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
libsdl-org/SDL#16530 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
FriendsofECCE/ECCE#336 · コメント 1 件 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
fw876/helloworld#2067 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
immortalwrt/immortalwrt#2501 ·