主要内容

针对 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) 安全编码标准,请打开模型顾问,并运行按任务 > 安全编码(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
Check usage of Assignment blocksmathworks.misra.AssignmentBlocks
Check for switch case expressions without a default casemathworks.misra.SwitchDefault
检查有符号整数的按位运算mathworks.misra.CompliantCGIRConstructions
Check for equality and inequality operations on floating-point valuesmathworks.misra.CompareFloatEquality
检查整数字长mathworks.misra.IntegerWordLengths

Detect 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
不适用不适用

Check usage of square root operations

mathworks.hism.hisl_0003
不适用不适用

Check usage of While Iterator blocks

mathworks.hism.hisl_0006
不适用不适用

Check data types for blocks with index signals

mathworks.hism.hisl_0022
不适用不适用

Check usage of Reciprocal Sqrt blocks

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