Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

`DIR-4-15`: Add support for `fpclassify()` functions.

オープン
#875 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
45/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
cpp
領域
devtools

調査の方向性

既存の DIR-4-15 実装と、issue で参照されている guards ライブラリのインフラストラクチャから始めます。直接条件、switch ケース、割り当てられた分類変数を含む、3 つの fpclassify guard パターンを比較します。対応する guarded conversion でエラーが発生しなくなり、guard されていない潜在的に安全でない conversion では引き続き診断が出力されれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Difficulty-Low false positive/false negative Impact-Low
Affected rules
  • DIR-4-15\
Description

The first implementation of the rule handles guards of the form isinf, isnan, isfinite, iszero, etc., however, it doesn't support guards relating to fpclassify().

Example
float may_be_inf() {
  ...
  return 1.0/0.0;
}

void fpclassify_guard() {
  float x = may_be_inf();
  int y;

  // error, casting possible infinity to int
  y = x; 

  // example 1: easiest to support:
  if (fpclassify(x) != FP_INFINITE) {
    // or "fpclassify(x) == FP_NORMAL"
    y = x;
  }

  // example 2: perhaps slightly harder to support, but guards library already has infra for this:
  switch(x) {
    case FP_NORMAL:
    case FP_SUBNORMAL:
    case FP_ZERO:
      // or, "case FP_INFINITE: break; default:"
      y = x;
  }

  // example 3: this is harder to support but a common pattern:
  int cls = fpclassify(x);
  if (cls != FP_INFINITE) {
    // or "cls == FP_NORMAL || cls == FP_ZERO"
    y = x;
  }   
}
主要言語
CodeQL
スター
227
フォーク
82
平均マージ
6日 7時間
マージ済み PR(30日)
9

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

github/codeql-coding-standards のほかの issue

github/codeql-coding-standards の issue をすべて見る

似ている issue

DevTools の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。