JavaScript is not currently enabled, but is required for full CodeSonar manual search and browse functionality.

If you are viewing this file in your hub's Web GUI, enable JavaScript in your browser: you will also need it for GUI functionality.

If you opened this file directly from disk, your browser may be directly suppressing JavaScript functionality: certain browsers perform this suppression on local files (but not files delivered by web servers) for security reasons.

CodeSonar® 9.2p0 CONFIDENTIAL CodeSecure Inc
C and C++


LANG.ARITH.FDIVZERO : 浮動小数点のゼロ除算

要旨

分母が0になる浮動小数点の割り算を実行しようとしています。

プロパティ

クラス名 Float Division By Zero
日本語クラス名 浮動小数点のゼロ除算
クラス分類 信頼性 (reliability)
ニーモニック LANG.ARITH.FDIVZERO
カテゴリー
MisraC2025 MisraC2025:1.3 There shall be no occurrence of undefined or critical unspecified behaviour
  MisraC2025:D.4.1 Run-time failures shall be minimized
MisraC2023 MisraC2023:1.3 There shall be no occurrence of undefined or critical unspecified behaviour
  MisraC2023:D.4.1 Run-time failures shall be minimized
Misra2012 Misra2012:1.3 There shall be no occurrence of undefined or critical unspecified behaviour
  Misra2012:D.4.1 Run-time failures shall be minimized
MisraC++2023 MisraC++2023:0.3.2 A function call shall not violate the function's preconditions
  MisraC++2023:4.1.3 There shall be no occurrence of undefined or critical unspecified behaviour
CWE CWE:369 Divide By Zero
  CWE:573 Improper Following of Specification by Caller
TS17961 TS17961:5.25-diverr Integer division errors
CERT-C CERT-C:INT33-C Ensure that division and remainder operations do not result in divide-by-zero errors
OWASP-2025 OWASP-2025:A10 Mishandling of Exceptional Conditions
対応言語 C および C++ で利用可能です。
有効/無効設定 このワーニングクラスのチェックはデフォルトで有効になっています。チェックを無効にするにはプロジェクト設定ファイル (configuration file)に以下の WARNING_FILTER ルールを追加してください。
WARNING_FILTER += discard class="Float Division By Zero"

float fdivzero(void){
    float c = 5.0;
    float d;
    d = c*c - 20.0;
    return d/(d-c);    /* 'Float Division by Zero' warning issued here */
}

関連のある設定ファイルパラメータ

設定ファイルの以下のパラメータがこのワーニングクラスのチェックに影響します。

 

To report problems with this documentation, please visit https://support.codesecure.com/.