Main Content

hisl_0073: ビットシフト演算の使用方法

ID: タイトルhisl_0073: ビットシフト演算の使用方法
説明

ビットシフト演算 (a >> b または a << b など) の場合は、以下を実行しないでください。

ビット幅以上のシフト演算 (b は a のビット幅以上であってはなりません)。

根拠シフト演算を含むコードを生成すると、コーディング規約違反を引き起こす可能性があります。
モデル アドバイザー チェックCheck usage of bit-shift operations (Simulink Check)
参考文献
  • DO-331 Section MB.6.3.1.b 'High-level requirements are accurate and consistent'

    DO-331 Section MB.6.3.2.b 'Low-level requirements are accurate and consistent'

  • IEC 61508–3, Table A.3 (2) Strongly typed programming language

    IEC 61508–3, Table A.4 (3) Defensive programming

  • IEC 62304, 5.5.3 - Software Unit acceptance criteria

  • ISO 26262-6, Table 1 (1b) Use of language subsets

    ISO 26262-6, Table 1 (1c) Enforcement of strong typing

    ISO 26262-6, Table 1 (1d) Use of defensive implementation techniques

  • EN 50128, Table A.3 (1) Defensive Programming

    EN 50128, Table A.4 (8) Strongly Typed Programming Language

  • MISRA C:2012, Rule 12.2

  • INT34-C. Do not shift an expression by a negative number of bits or by greater than or equal to the number of bits that exist in the operand

参考

生成されたコードにおける調整可能なキャリブレーション パラメーターの作成 (Simulink Coder)

最終更新R2021b