Excellent docs on numeric casting in C++
まだ誰も着手していません。
- 主要言語
- 言語のデータがありません
- スター
- 110
- フォーク
- 17
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
Without strict compiler warnings, it is possible to write quite a bit of C++ without it be obvious once needs to study the details of numeric casting. Implicit conversion will convert various integer types to other integer types and to floating point types, quietly and hopefully correctly.
Because we can't have correct code based on hope, we should instead enable warnings from the get go that warn about implicit conversion and specifically truncating or narrowing conversion and convertions that might overflow.
So, we want to enable warnings like -Wconversion per #37.
What this means is that you'll get loud warnings right away about converting types and will need to figure out how to avoid or suppress them correctly, to fix the potential existing bugs they hint at and avoid creating new bugs in the process.
Refs https://github.com/mapbox/node-cpp-skel/pull/78#discussion_r144410926 https://github.com/mapbox/carmen-cache/issues/94
refs https://github.com/mapbox/gzip-hpp/pull/19#issuecomment-336537155
/cc @mapsam @GretaCB @flippmoke
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず issue #37 と、そこで参照されているディスカッションおよび pull requests を確認し、意図された警告設定を理解します。次に、リポジトリのビルド設定を調べ、提案された変換警告を有効にしてコンパイルします。警告が有効になり、その結果生じる既存の切り捨て、縮小変換、オーバーフロー、または暗黙の変換に関する警告が修正されるか、明示的に抑制されれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- cpp
- 領域
- build-system, tooling
- issue の種類
- 機能追加
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100