Contenido principal

Check for bitwise operations on signed integers

Check ID: mathworks.misra.CompliantCGIRConstructions

Identify Simulink blocks that contain bitwise operations on signed integers.

Description

Following the recommendations of this check increases the likelihood of generating MISRA C:2012 and MISRA C:2023 compliant code for embedded applications, as well as code that complies with the CERT C and CWE standards.

Available with Embedded Coder® and Simulink® Check™.

Note

Stateflow® license is needed if the model contains Stateflow elements.

Results and Recommended Actions

ConditionRecommended Action
The model has blocks that contain bitwise operations on signed integers.Consider using unsigned integers for bitwise operations.

Capabilities and Limitations

  • Check operates at the generated code level rather than the model level. Consequently, it might not flag blocks if the generated code does not exhibit insecure input validation, even if the underlying model could potentially produce such issues. To overcome this limitation, use the Check usage of bit operation blocks check, which is designed to detect insecure input validation at the model level.

See Also