misra.config 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. // MISRA C-2012 Rules
  2. {
  3. version : "2.0",
  4. standard : "c2012",
  5. title: "Coverity MISRA Configuration",
  6. deviations : [
  7. // Disable the following rules.
  8. {
  9. deviation: "Directive 4.5",
  10. reason: "Allow names that MISRA considers ambiguous (such as enum IOT_MQTT_CONNECT and function IotMqtt_Connect)."
  11. },
  12. {
  13. deviation: "Directive 4.6",
  14. reason: "The third-party http-parser library does not use specific-length typedefs for their callback function signatures and public structure fields. http-parser callbacks are implemented in the HTTP Client source and also flags of basic numerical types are checked from the http-parser structure."
  15. },
  16. {
  17. deviation: "Directive 4.8",
  18. reason: "Allow inclusion of unused types. Header files for a specific port, which are needed by all files, may define types that are not used by a specific file."
  19. },
  20. {
  21. deviation: "Directive 4.9",
  22. reason: "Allow inclusion of function like macros. The `assert` macro is used throughout the library for parameter validation, and logging is done using function like macros."
  23. },
  24. {
  25. deviation: "Rule 2.3",
  26. reason: "Allow unused types. Library headers may define types intended for the application's use, but not used within the library files."
  27. },
  28. {
  29. deviation: "Rule 2.4",
  30. reason: "Allow unused tags. Some compilers warn if types are not tagged."
  31. },
  32. {
  33. deviation: "Rule 2.5",
  34. reason: "Allow unused macros. Library headers may define macros intended for the application's use, but not used by a specific file."
  35. },
  36. {
  37. deviation: "Rule 3.1",
  38. reason: "Allow nested comments. C++ style `//` comments are used in example code within Doxygen documentation blocks."
  39. },
  40. {
  41. deviation: "Rule 8.7",
  42. reason: "API functions are not used by the library outside of the files they are defined; however, they must be externally visible in order to be used by an application."
  43. },
  44. {
  45. deviation: "Rule 8.13",
  46. reason: "The third-party http-parser library callback definitions have a non-const parameter which holds the state of the parsing. This parameter is never updated in the callback implementations, but have fields that may be read."
  47. },
  48. {
  49. deviation: "Rule 11.5",
  50. reason: "Allow casts from `void *`. The third-party http-parser library callback contexts are saved as `void *` and must be cast to the correct data type before use. |"
  51. },
  52. {
  53. deviation: "Rule 21.1",
  54. reason: "Allow use of all names."
  55. },
  56. {
  57. deviation: "Rule 21.2",
  58. reason: "Allow use of all names."
  59. }
  60. ]
  61. }