主要内容

针对 CERT C、CWE 和 ISO/IEC TS 17961 编码标准的模型顾问检查

R2026b

这些检查用于验证 Embedded Coder® 生成的代码是否符合 CERT C、CWE 和 ISO/IEC TS 17961 (Embedded Coder) 安全编码标准。这些模型顾问检查有助于生成符合 CERT C、CWE 和 ISO/IEC TS 17961 (Embedded Coder) 安全编码标准的代码。

要检查您的代码是否符合 CERT C、CWE 和 ISO/IEC TS 17961 (Embedded Coder) 安全编码标准,请打开模型顾问,并运行按任务 > 安全编码(CERT C、CWE、ISO/IEC TS 17961)建模规范中的检查。

执行这些检查需要 Embedded Coder 或 Simulink® Check™。有些检查要求 Simulink Design Verifier™。

安全编码标准模型顾问检查检查 ID
CERT CCWEISO/IEC TS 17961
✔✔✔Check configuration parameters for secure coding standardsmathworks.security.CodeGenSettings
✔✔✔Check for blocks not recommended for C/C++ production code deploymentmathworks.codegen.PCGSupport
✔✔✔Check for blocks not recommended for secure coding standardsmathworks.security.BlockSupport
✔✔✔检查 Assignment 模块的使用mathworks.misra.AssignmentBlocks
✔✔✔Check for switch case expressions without a default casemathworks.misra.SwitchDefault
✔✔✔检查有符号整数的按位运算mathworks.misra.CompliantCGIRConstructions
✔✔✔检查浮点值的相等和不相等运算mathworks.misra.CompareFloatEquality
✔✔✔检查整数字长mathworks.misra.IntegerWordLengths
✔✔✔

Check for dead logic

mathworks.sldv.deadlogic
✔✔✔

检查整数溢出

mathworks.sldv.integeroverflow
✔✔✔

检查是否存在除以零错误

mathworks.sldv.divbyzero
✔✔✔

检查数组访问越界

mathworks.sldv.arraybounds
✔✔✔

检查指定的最小值和最大值违规

mathworks.sldv.minmax
✔不适用不适用Check configuration parameters for MISRA C:2023mathworks.misra.CodeGenSettings
✔不适用不适用

Check usage of Abs blocks

mathworks.hism.hisl_0001
✔不适用不适用

Check usage of remainder and reciprocal operations

mathworks.sldv.hism.hisl_0002
✔不适用不适用

检查平方根运算的使用

mathworks.hism.hisl_0003
✔不适用不适用

检查 While Iterator 模块的使用

mathworks.hism.hisl_0006
✔不适用不适用

Check data types for blocks with index signals

mathworks.hism.hisl_0022
✔不适用不适用

检查 Reciprocal Sqrt 模块的使用

mathworks.hism.hisl_0028
✔不适用不适用

Check global variables in graphical functions

mathworks.hism.hisl_0062
✔不适用不适用

Check usage of bit-shift operations

mathworks.hism.hisl_0073
✔不适用不适用

Check safety-related optimization settings for data type conversions

mathworks.hism.hisl_0053
✔不适用不适用

Check safety-related optimization settings for integer division arithmetic exceptions

mathworks.hism.hisl_0054
✔不适用不适用

Check model file name

mathworks.hism.hisl_0031
✔不适用不适用

Check model object names

mathworks.hism.hisl_0032