]> begriffs open source - cmsis/blob - CMSIS/DoxyGen/Core/src/MISRA.txt
Merge branch 'develop' of https://github.com/ARM-software/CMSIS_5 into develop
[cmsis] / CMSIS / DoxyGen / Core / src / MISRA.txt
1 /** \page coreMISRA_Exceptions_pg MISRA-C Deviations
2 CMSIS-CORE uses the common coding rules for CMSIS components that are documented under 
3 <a href="../../General/html/index.html"><b>Introduction</b></a>.
4
5
6 CMSIS-CORE violates the following MISRA-C:2004 rules:
7   
8 - Required Rule 8.5, object/function definition in header file.<br>
9   Violated since function definitions in header files are used for function inlining'. 
10    
11 - Advisory Rule 12.4, Side effects on right hand side of logical operator.<br>
12   Violated because volatile is used for core register definitions. 
13    
14 - Advisory Rule 14.7, Return statement before end of function.<br>
15   Violated to simplify code logic. 
16
17 - Required Rule 18.4, declaration of union type or object of union type: '{...}'.<br>
18   Violated since unions are used for effective representation of core registers.
19    
20 - Advisory Rule 19.4, Disallowed definition for macro.<br>
21   Violated since macros are used for assembler keywords. 
22    
23 - Advisory Rule 19.7, Function-like macro defined.<br>
24   Violated since function-like macros are used to generate more efficient code. 
25    
26 - Advisory Rule 19.16, all preprocessing directives must be valid.<br>
27   Violated to set default settings for macros. 
28
29   
30 CMSIS-CORE violates the following MISRA-C:2012 rules:
31   
32 - Directive 4.9, function-like macro defined.<br>
33   Violated since function-like macros are used to generate more efficient code. 
34    
35 - Rule 1.3, multiple use of '#/##' operators in macro definition.<br>
36   Violated since function-like macros are used to generate more efficient code. 
37    
38 - Rule 11.4, conversion between a pointer and integer type.<br>
39   Violated because of core register access. 
40    
41 - Rule 11.6, cast from unsigned long to pointer.<br>
42   Violated because of core register access. 
43    
44 - Rule 13.5, side effects on right hand side of logical operator.<br>
45   Violated because of shift operand is used in macros and functions. 
46    
47 - Rule 14.4, conditional expression should have essentially Boolean type.<br>
48   Violated since macros with several instructions are used.
49   
50 - Rule 15.5, return statement before end of function.<br>
51   Violated to simplify code logic. 
52
53 - Rule 20.10, '#/##' operators used.<br>
54   Violated since function-like macros are used to generate more efficient code. 
55    
56 - Rule 21.1, reserved to the compiler.<br>
57   Violated since macros with leading underscores are used. 
58    
59
60   
61 &lt;device&gt;.h files generated by <b>SVDConv.exe</b> violate the following MISRA-C:2004 rules:
62
63 - Advisory Rule 20.2, Re-use of C90 identifier pattern.<br>
64   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. 
65
66 - Advisory Rule 19.1, Declaration before \#include.<br>
67   Violated since Interrupt Number Definition Type (IRQn_Type) must be defined before including the core header file. 
68  */
69