clang-tidy v. -Weffc++
まだ誰も着手していません。
- 主要言語
- 言語のデータがありません
- スター
- 110
- フォーク
- 17
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
Context
Recent versions of clang-tidy added readability-redundant-member-init: https://clang.llvm.org/extra/clang-tidy/checks/readability-redundant-member-init.html
This is handy! When a class member has a default initializer it is redundent to initialize it in the member list.
But, because some types don't have default initializers, forgetting to initialize them in the member list (or using c++11 initialization in the class definition) can lead to serious trouble like mapbox/wagyu#69 - refs mapbox/wagyu#70.
So, this is the reason, at https://github.com/mapbox/cpp/issues/37#issuecomment-336200744, that we recommend using g++ and the -Weffc++ flag because it can catch this (note, clang++ plus -Weffc++ cannot):
-Weffc++ - useful when building with g++ (does not do much with clang++). With g++ it can catch uninitialized class members and prevent crashes like mapbox/wagyu#69 - refs mapbox/wagyu#70
Problem
-Weffc++will warn on all class members not explicitly initialized in the initializer listclang-tidywill automatically remove variables from the initializer list that have default constructors
So, the two will fight: causing each other warnings. For this reason I think we should likely:
- let clang-tidy win
- recommend no longer using g++ with
-Weffc++ - figure out what alternative way we can catch when members, without default initializers, are uninitialized (without needing to use
-Weffc++). Maybe anotherclang-tidycheck?
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
clang-tidy's readability-redundant-member-init のドキュメントと、リンクされている mapbox/cpp#37、wagyu#69、wagyu#70 の議論から始めてください。リポジトリのファイルやテストは特定されていません。-Weffc++、clang-tidy のガイダンス、および未初期化メンバーの検出について、合意されたアプローチを決定してください。完了条件は、文書化された推奨事項と設定があることです。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- cpp
- 領域
- tooling
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 30/100