CMSIS-CORE  Version 4.30
CMSIS-CORE support for Cortex-M processor-based devices
 All Data Structures Files Functions Variables Enumerations Enumerator Groups Pages
MISRA-C:2004 Compliance Exceptions

CMSIS-CORE uses the common coding rules for CMSIS components that are documented under Introduction.

CMSIS-CORE violates the following MISRA-C:2004 rules:

  • Required Rule 8.5, object/function definition in header file.
    Violated since function definitions in header files are used for function inlining'.
  • Advisory Rule 12.4, Side effects on right hand side of logical operator.
    Violated because volatile is used for core register definitions.
  • Advisory Rule 14.7, Return statement before end of function.
    Violated to simplify code logic.
  • Required Rule 18.4, declaration of union type or object of union type: '{...}'.
    Violated since unions are used for effective representation of core registers.
  • Advisory Rule 19.4, Disallowed definition for macro.
    Violated since macros are used for assembler keywords.
  • Advisory Rule 19.7, Function-like macro defined.
    Violated since function-like macros are used to generate more efficient code.
  • Advisory Rule 19.16, all preprocessing directives must be valid.
    Violated to set default settings for macros.

<device>.h files generated by SVDConv.exe violate the following MISRA-C:2004 rules:

  • Advisory Rule 20.2, Re-use of C90 identifier pattern.
    Violated since CMSIS macros begin with '__'. Since CMSIS is developed and verified with various compilers this approach is acceptable and avoids conflicts with user symbols.
  • Advisory Rule 19.1, Declaration before #include.
    Violated since Interrupt Number Definition Type (IRQn_Type) must be defined before including the core header file.