Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

DIR-4-15: Add support forfpclassify() functions. #875

Open
Labels
Difficulty-LowA false positive or false negative report which is expected to take <1 day effort to addressImpact-Lowfalse positive/false negativeAn issue related to observed false positives or false negatives.
@MichaelRFairhurst

Description

@MichaelRFairhurst

Affected rules

  • DIR-4-15\

Description

The first implementation of the rule handles guards of the formisinf,isnan,isfinite,iszero, etc., however, it doesn't support guards relating tofpclassify().

Example

floatmay_be_inf() {  ...return1.0/0.0;}voidfpclassify_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;  }   }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Difficulty-LowA false positive or false negative report which is expected to take <1 day effort to addressImpact-Lowfalse positive/false negativeAn issue related to observed false positives or false negatives.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp