Phase 2: -Wignored-qualifiers を潰して -Werror=ignored-qualifiers を有効化 - #68
Merged
Conversation
The three static helpers `get_i_id_product_start/material_start/work_start` return `uint32_t` by value, but were declared with a top-level `const` on the return type. GCC's `-Wignored-qualifiers` flags this as a no-op qualifier (a value-returned `const uint32_t` is no different from `uint32_t` to the caller). Drop the redundant `const` from the return type in both bomb.hh and bomb_pessimistic.hh.
3 tasks
This was referenced May 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#43 Phase 2 のサブタスク。
-Wignored-qualifiersの警告を潰し、ccbench_add_protocol()に-Werror=ignored-qualifiersを追加する。修正概要
GCC 13 build で得た hits は実体 6 箇所 (
include/bomb.hhx3 行 +include/bomb_pessimistic.hhx3 行) のみ。複数プロトコルから include されるためコンパイル単位ごとに重複していたが、ユニーク行は次のとおり。include/bomb.hhL506get_i_id_product_start()const uint32_tからconst削除include/bomb.hhL510get_i_id_material_start()include/bomb.hhL514get_i_id_work_start()include/bomb_pessimistic.hhL540get_i_id_product_start()include/bomb_pessimistic.hhL544get_i_id_material_start()include/bomb_pessimistic.hhL548get_i_id_work_start()いずれも「値返却関数の return type に付いた top-level
const」パターン。const uint32_tを値で返しても呼び出し側からはuint32_tと区別がつかず、-Wignored-qualifiersが正しく no-op qualifier として検出していた。真のバグ (UB / 動作差分) を生むコードは無し — 純粋にノイズの削除。CMake
cmake/ProtocolHelpers.cmakeのtarget_compile_options末尾に-Werror=ignored-qualifiersを追加 (既存 7 行は変更なし)。Test plan
-DENABLE_SANITIZER=OFF: 34/34 ビルド成功Related
-Wsign-comparePR is in flight separately)