mtk.lnt 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. // Standard lint options in MTK
  2. // MTK Log Format
  3. // -hsb_3 // formatting options required for MicroVision IDE
  4. // -format="*** LINT: %(%f(%l) %)%t %n: %m"
  5. // -width(0,10) // Don't break lines
  6. // MTK requirements
  7. -t4 /* TAB=4 */
  8. -A /* strict ANSI */
  9. // -w2 /* Show Error and Warning only */
  10. // MTK Coding Standards
  11. -append(537,[MTK Rule 2.1.3]) // Repeated include file
  12. +e725 // Expected positive indentation from ...
  13. -append(525,[MTK Rule 2.2.3]) // Negative indentation from ...
  14. -append(539,[MTK Rule 2.2.3]) // Did not expect positive indentation from ...
  15. -append(725,[MTK Rule 2.2.3])
  16. +e960 // Violates MISRA Required Rule
  17. +e961 // Violates MISRA Advisory Rule
  18. -append(960(42),[MTK Rule 2.2.6]) // Comma operator used outside of 'for'
  19. +e721 // Suspicious use of ';'
  20. +e722 // Suspicious use of ';'
  21. -append(721,[MTK Rule 2.2.8])
  22. -append(722,[MTK Rule 2.2.8])
  23. -append(960(59),[MTK Rule 2.2.8]) // Left brace expected for if, else, for, do and while
  24. +e783 // Line does not end with new-line
  25. -append(783,[MTK Rule 2.2.11])
  26. // 5.1.1 Always declare an explicit function return type
  27. -fvr /* varying return mode not allowed */
  28. +e745 // Function has no explicit type
  29. -append(745,[MTK Rule 5.1.1])
  30. // 5.1.2 Always provide formal parameter names in function declaraions
  31. +e718 // Symbol undeclared
  32. +e936 // Old-style function definition
  33. +e937 // Old-style function declaration
  34. +e938 // Parameter not explicitly declared
  35. +e957 // Function defined without a prototype in scope
  36. -append(628,[MTK Rule 5.1.2]) // No argument information provided for function
  37. -append(718,[MTK Rule 5.1.2])
  38. -append(936,[MTK Rule 5.1.2])
  39. -append(937,[MTK Rule 5.1.2])
  40. -append(938,[MTK Rule 5.1.2])
  41. -append(957,[MTK Rule 5.1.2])
  42. -append(18,[MTK Rule 5.1.5]) /* symbol redeclared */
  43. -append(516,[MTK Rule 5.1.5]) // Symbol has arg. type conflict
  44. -append(532,[MTK Rule 5.1.5]) // Return mode of function inconsistent with ...
  45. -append(578,[MTK Rule 5.1.5]) // Declaration of symbol x hides symbol (location)
  46. -append(580,[MTK Rule 5.1.5]) // Redeclaration of function causes loss of prototype
  47. -append(652,[MTK Rule 5.1.5]) // #define of symbol declared previously at ...
  48. -append(674,[MTK Rule 5.1.6]) // Returning address of auto variable
  49. +e970 // Use of modifier or type outside of a typedef
  50. +e971 // Use of 'char' without 'signed' or 'unsigned'
  51. -append(970,[MTK Rule 5.2.1])
  52. -append(971,[MTK Rule 5.2.1])
  53. +e834 // Operator 'x' followed by operator 'y' is confusing.
  54. // Use parentheses
  55. -append(834,[MTK Rule 6.1.1])
  56. +e731 // Boolean argument to equal/not euqal
  57. -append(506,[MTK Rule 6.1.3]) // Constant value Boolean
  58. -append(731,[MTK Rule 6.1.3])
  59. +e773 // Expression-like macro not parenthesized
  60. -append(773,[MTK Rule 6.1.4])
  61. +e744 // Switch has no default
  62. -append(744,[MTK Rule 6.2.2])
  63. -append(960(60),[MTK Rule 6.2.2]) // No 'else' at end of 'is else if' chain
  64. -append(961(60),[MTK Rule 6.2.2])
  65. +e801 // Use of goto is deprecated
  66. -append(801,[MTK Rule 6.2.3])
  67. -append(960(58),[MTK Rule 6.2.4]) // 'break' used outside of a 'switch'
  68. // 6.2.5 Avoid variables used before being explicity initialized
  69. +e727 // Static or global variable not explicitly initialized
  70. +e728
  71. +e729
  72. +e771 /* Symbol conceivably not initialized */
  73. +e772
  74. -append(530,[MTK Rule 6.2.5]) // Local vairable not initialized
  75. -append(603,[MTK Rule 6.2.5])
  76. -append(644,[MTK Rule 6.2.5]) // Variable may not been initialized
  77. -append(645,[MTK Rule 6.2.5])
  78. -append(727,[MTK Rule 6.2.5])
  79. -append(728,[MTK Rule 6.2.5])
  80. -append(729,[MTK Rule 6.2.5])
  81. -append(771,[MTK Rule 6.2.5])
  82. -append(772,[MTK Rule 6.2.5])
  83. +e794 // Conceivable use of null pointer
  84. -append(413,[MTK Rule 7.1.1]) // Likely use of null pointer
  85. -append(613,[MTK Rule 7.1.1]) // Possible use of null pointer
  86. -append(794,[MTK Rule 7.1.1])
  87. -append(415,[MTK Rule 8.2.3]) // Access of out-of-bounds pointer
  88. -append(564,[MTK Rule 8.2.5]) // Variable depends on order of evaluation
  89. -append(961(47),[MTK Rule 8.2.5]) // Dependence placed on C's operator precedence
  90. +e713 // Loss of precision without casting
  91. +e732 // Loss of sign without casting
  92. +e737 // Loss of sign in promotion
  93. +e912 // Implicit binary conversion
  94. -append(570,[MTK Rule 8.2.6]) // Loss of sign
  95. -append(713,[MTK Rule 8.2.6])
  96. -append(732,[MTK Rule 8.2.6])
  97. -append(737,[MTK Rule 8.2.6])
  98. -append(912,[MTK Rule 8.2.6])
  99. +e701 // Shift left of signed quantity
  100. +e702 // Shift right of signed quantity
  101. -append(701,[MTK Rule 8.2.7])
  102. -append(702,[MTK Rule 8.2.7])
  103. +e712 // Loss of precision
  104. +e747 // Significant prototype coercion
  105. +e912 // Implicit binary conversion
  106. +e917 // Prototype coercion
  107. +e918 // Prototype coercion of pointers
  108. +e920 // Cast from Type to void
  109. -append(712,[MTK Rule 8.3.1])
  110. -append(747,[MTK Rule 8.3.1])
  111. -append(912,[MTK Rule 8.3.1])
  112. -append(917,[MTK Rule 8.3.1])
  113. -append(918,[MTK Rule 8.3.1])
  114. -append(920,[MTK Rule 8.3.1])
  115. +e740 // Unusual pointer cast (incompatible indirect types)
  116. -append(740,[MTK Rule 8.3.2])
  117. +e793 // ANSI limit of 'xxx' exceeded
  118. +e950 // Non-ANSI reserved word or constrcut
  119. -append(793,[MTK Rule 10.1.1])
  120. -append(950,[MTK Rule 10.1.1])
  121. // Check MISRA's rules
  122. .\lnt\au-misra.lnt
  123. // Message suppression (un-used errors or warnings)
  124. -e14 // Symbol previously defined
  125. // JL Added Message suppression (un-used errors or warnings)
  126. -e714 // Symbol not referenced
  127. -e716 // while (1) ...
  128. -e734 // Loss of precision
  129. -e746 // Call to function not made in the presence of a prototype
  130. -e749 -e?75? -e?76? // Constructs not reference
  131. -e778 // Constant expression evaluates to 0
  132. -e827 // Loop not reachable
  133. -esym( 960, 33, 68 ) // Side effect on right hand side of logical operator
  134. // Function not declared in file scope
  135. -esym( 961, 18, 55 ) // Constant requires numerical suffix
  136. // Non-case lable