Quantcast

Documentation Center

  • Trial Software
  • Product Updates

Contents

System Level

hisl_0401: Encapsulation of code to improve MISRA-C:2004 compliance

ID: Titlehisl_0401: Encapsulation of code to improve MISRA-C:2004 compliance
DescriptionTo improve the MISRA-C:2004 compliance of the generated code, encapsulate manually inserted code. This code includes, but is not limited to, C, Fortran, and assembly code.
RationaleImprove MISRA-C:2004 compliance of the generated code
See Also
Notes

Simulink provides multiple methods for integrating existing code. The user is responsible for encapsulating the generated code.

Encapsulation can be defined as "the process of compartmentalizing the elements of an abstraction that constitute its structure and behavior; encapsulation serves to separate the contractual interface of an abstraction and its implementation" a

References
  • MISRA-C: 2004 Rule 2.1

Last ChangedR2012a

aBooch, Grady, R. Maksimchuk, M. Engle, B. Young, J. Conallen, K. Houston. Object-Oriented Analysis and Design with Applications. 3rd ed. Boston, MA: Addison-Wesley Professional, 2007.

hisl_0402: Use of custom #pragma to improve MISRA-C:2004 compliance

ID: Titlehisl_0402: Use of custom #pragma to improve MISRA-C:2004 compliance
DescriptionTo improve the MISRA-C:2004 compliance of the generated code, document user defined pragma. In the documentation, include:
AMemory range (start and stop address)
BIntended use
CJustification for using a pragma
RationaleImprove MISRA-C:2004 compliance of the generated code
See Also
Notes

The Simulink Report Generator™ documents pragmas.

References
  • MISRA-C: 2004 Rule 3.4

Last ChangedR2012a

hisl_0403: Use of char data type improve MISRA-C:2004 compliance

ID: Titlehisl_0403: Use of char data type to improve MISRA-C:2004 compliance
DescriptionTo improve the MISRA-C:2004 compliance of the generated code with custom storage classes that use the Char data type, only use:
APlain char type for character values.
BSigned and unsigned char type for numeric values.
 
RationaleImprove MISRA-C:2004 compliance of the generated code. 
See Also 
References
  • MISRA-C: 2004 Rule 6.1

  • MISRA-C: 2004 Rule 6.2

 
Last ChangedR2012a 

Was this topic helpful?