Skip to content

Phase 2: -Wsign-compare を潰して -Werror=sign-compare を有効化 - #69

Merged
thawk105 merged 4 commits into
masterfrom
werror-sign-compare
May 14, 2026
Merged

Phase 2: -Wsign-compare を潰して -Werror=sign-compare を有効化#69
thawk105 merged 4 commits into
masterfrom
werror-sign-compare

Conversation

@thawk105

Copy link
Copy Markdown
Owner

#43 Phase 2 のサブタスク。-Wsign-compare を潰し、ccbench_add_protocol()-Werror=sign-compare を追加する。

並列 subagent (background) が 4 commit + push まで実行、PR 作成段階で停止していたため、親エージェントが PR 作成 + CI watch を引き継いだ。

修正

subagent が小刻みに commit してくれているのでファイル単位:

commit 内容
9ef4f9c Phase 2: enable -Werror=sign-compare (cmake side)
03a76e8 Phase 2: fix sign-compare in include/bomb.hh
f0397aa Phase 2: fix sign-compare in include/bomb_pessimistic.hh
43852ca Phase 2: fix sign-compare in masstree_wrapper.hh and cc/oze/util.cc

修正パターン

-Wsign-compare の典型 (signed vs size_t / unsigned の比較) を各箇所で:

  • int i; for(i=0; i<container.size(); ++i) 系のループ counter → 容量を表す側に合わせて修正
  • intgoogle::uint32 / google::uint64 の比較 → cast or 型変更
  • std::vector::size_typeint64_t の比較 (masstree_wrapper の scan limit 周り)

CMake

 target_compile_options(${target} PRIVATE
   -Werror=maybe-uninitialized
   -Werror=unused-but-set-variable
   -Werror=unused-label
   -Werror=reorder
   -Werror=unused-parameter
   -Werror=catch-value
-  -Werror=unused-variable)
+  -Werror=unused-variable
+  -Werror=sign-compare)

Subagent prompt 改善のメモ

前回 (1 回目) は context window 枯渇で死亡、進捗ゼロだった。今回 (再投入) は改良 prompt:

  • build 出力は tee /tmp/build.log >/dev/null 経由で抜粋のみ取得
  • -j4 固定
  • 小刻みに commit (cmake → 各ソース) ← この PR が示す通り、subagent が PR 作成段階で死んでも 4 commit + push は残った
  • 結果として「PR 作成だけ親が引き取る」最小コストで完走

詳細な学習は親エージェントの memory に保存済み。

Test plan

  • subagent が GCC 13 Release / -DENABLE_SANITIZER=OFF で 34/34 確認 (subagent レポートより)
  • subagent が GCC 11 Debug + ASan で 34/34 確認
  • CI 緑

Related

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant