CodeCheck Documentation
CodeCheck Documentation - MISRA C 2025

Standard: MISRA C 2025

All RulesAdvisory RulesMandatory RulesRequired Rules
Understand % Coverage85%84%82%86%
Understand Coverage1873818131
Total Rules2194522152
Check IDCheck NameSupportedCategory
MISRA25_1.1The program shall contain no violations of the standard C syntax and constraints, and shall not exceed the implementation's translation limitsNoRequired
MISRA25_1.3There shall be no occurrence of undefined or critical unspecified behaviourNoRequired
MISRA25_1.41.4 Emergent language features shall not be usedYesRequired
MISRA25_1.51.5 Obsolescent language features shall not be usedYesRequired
MISRA25_2.12.1 A project shall not contain unreachable codeYesRequired
MISRA25_2.2A project shall not contain dead codeNoRequired
MISRA25_2.32.3 A project should not contain unused type declarationsYesAdvisory
MISRA25_2.42.4 A project should not contain unused tag declarationsYesAdvisory
MISRA25_2.52.5 A project should not contain unused macro declarationsYesAdvisory
MISRA25_2.6A function should not contain unused label declarationsYesAdvisory
MISRA25_2.72.7 A function should not contain unused parametersYesAdvisory
MISRA25_2.8A project should not contain unused object definitionsYesAdvisory
MISRA25_3.1 shall not be used within a commentYesRequired
MISRA25_3.2 commentsYesRequired
MISRA25_4.14.1 Octal and hexadecimal escape sequences shall be terminatedYesRequired
MISRA25_4.24.2 Trigraphs should not be usedYesAdvisory
MISRA25_5.15.1 External identifiers shall be distinctYesRequired
MISRA25_5.25.2 Identifiers declared in the same scope and name space shall be distinctYesRequired
MISRA25_5.35.3 An identifier declared in an inner scope shall not hide an identifier declared in an outer scopeYesRequired
MISRA25_5.45.4 Macro identifiers shall be distinctYesRequired
MISRA25_5.55.5 Identifiers shall be distinct from macro namesYesRequired
MISRA25_5.65.6 A typedef name shall be a unique identifierYesRequired
MISRA25_5.75.7 A tag name shall be a unique identifierYesRequired
MISRA25_5.85.8 Identifiers that define objects or functions with external linkage shall be uniqueYesRequired
MISRA25_5.95.9 Identifiers that define objects or functions with internal linkage should be uniqueYesAdvisory
MISRA25_5.105.10 A reserved identifier or reserved macro name shall not be declaredYesRequired
MISRA25_6.16.1 Bit-fields shall only be declared with an appropriate typeYesRequired
MISRA25_6.26.2 Single-bit named bit-fields shall not be of a signed typeYesRequired
MISRA25_6.36.3 A bit-field shall not be declared as a member of a unionYesRequired
MISRA25_7.17.1 Octal constants shall not be usedYesRequired
MISRA25_7.27.2 A u or U suffix shall be applied to all integer constants that are represented in an unsigned typeYesRequired
MISRA25_7.37.3 The lowercase character 'l' shall not be used in a literal suffixYesRequired
MISRA25_7.47.4 A string literal shall not be assigned to an object unless the object's type is "pointer to const-qualified char"YesRequired
MISRA25_7.57.5 The argument of an integer constant macro shall have an appropriate formYesMandatory
MISRA25_7.67.6 The small integer variants of the minimum-width integer constant macros shall not be usedYesRequired
MISRA25_8.1Types shall be explicitly specifiedYesRequired
MISRA25_8.2Function types shall be in prototype form with named parametersYesRequired
MISRA25_8.38.3 All declarations of an object or function shall use the same names and type qualifiersYesRequired
MISRA25_8.48.4 A compatible declaration shall be visible when an object or function with external linkage is definedYesRequired
MISRA25_8.58.5 An external object or function shall be declared once in one and only one fileYesRequired
MISRA25_8.68.6 An identifier with external linkage shall have exactly one external definitionYesRequired
MISRA25_8.78.7 Functions and objects should not be defined with external linkage if they are referenced in only one translation unitYesAdvisory
MISRA25_8.88.8 The static storage class specifier shall be used in all declarations of objects and functions that have internal linkageYesRequired
MISRA25_8.98.9 An object should be defined at block scope if its identifier only appears in a single functionYesAdvisory
MISRA25_8.108.10 An inline function shall be declared with the static storage classYesRequired
MISRA25_8.118.11 When an array with external linkage is declared, its size should be explicitly specifiedYesAdvisory
MISRA25_8.128.12 Within an enumerator list, the value of an implicitly-specified enumeration constant shall be uniqueYesRequired
MISRA25_8.138.13 A pointer should point to a const-qualified type whenever possibleYesAdvisory
MISRA25_8.148.14 The restrict type qualifier shall not be usedYesRequired
MISRA25_8.158.15 All declarations of an object with an explicit alignment specification shall specify the same alignmentYesRequired
MISRA25_8.168.16 The alignment specification of zero should not appear in an object declarationYesAdvisory
MISRA25_8.178.17 At most one explicit alignment specifier should appear in an object declarationYesAdvisory
MISRA25_9.19.1 The value of an object with automatic storage duration shall not be read before it has been setYesMandatory
MISRA25_9.29.2 The initializer for an aggregate or union shall be enclosed in bracesYesRequired
MISRA25_9.39.3 Arrays shall not be partially initializedYesRequired
MISRA25_9.49.4 An element of an object shall not be initialized more than onceYesRequired
MISRA25_9.59.5 Where designated initializers are used to initialize an array object the size of the array shall be specified explicitlyYesRequired
MISRA25_9.69.6 An initializer using chained designators shall not contain initializers without designatorsYesRequired
MISRA25_9.79.7 Atomic objects shall be appropriately initialized before being accessedYesMandatory
MISRA25_10.110.1 Operands shall not be of an inappropriate essential typeYesRequired
MISRA25_10.210.2 Expressions of essentially character type shall not be used inappropriately in addition and subtraction operationsYesRequired
MISRA25_10.310.3 The value of an expression shall not be assigned to an object with a narrower essential type or of a different essential type categoryYesRequired
MISRA25_10.410.4 Both operands of an operator in which the usual arithmetic conversions are performed shall have the same essential type categoryYesRequired
MISRA25_10.5The value of an expression should not be cast to an inappropriate essential typeYesAdvisory
MISRA25_10.610.6 The value of a composite expression shall not be assigned to an object with wider essential typeYesRequired
MISRA25_10.7If a composite expression is used as one operand of an operator in which the usual arithmetic conversions are performed then the other operand shall not have wider essential typeYesRequired
MISRA25_10.810.8 The value of a composite expression shall not be cast to a different essential type category or a wider essential typeYesRequired
MISRA25_11.111.1 Conversions shall not be performed between a pointer to a function and any other typeYesRequired
MISRA25_11.211.2 Conversions shall not be performed between a pointer to an incomplete type and any other typeYesRequired
MISRA25_11.311.3 A conversion shall not be performed between a pointer to object type and a pointer to a different object typeYesRequired
MISRA25_11.411.4 A conversion shall not be performed between a pointer to object and an arithmetic typeYesRequired
MISRA25_11.511.5 A conversion should not be performed from pointer to void into pointer to objectYesAdvisory
MISRA25_11.6A cast shall not be performed between pointer to void and an arithmetic typeYesRequired
MISRA25_11.811.8 A conversion shall not remove any const, volatile or _Atomic qualification from the type pointed to by a pointerYesRequired
MISRA25_11.911.9 The macro NULL shall be the only permitted form of integer null pointer constantYesRequired
MISRA25_11.10The _Atomic qualifier shall not be applied to the incomplete type voidYesRequired
MISRA25_12.1The precedence of operators within expressions should be made explicitNoAdvisory
MISRA25_12.212.2 The right hand operand of a shift operator shall lie in the range zero to one less than the width in bits of the essential type of the left hand operandYesRequired
MISRA25_12.3The comma operator should not be usedYesAdvisory
MISRA25_12.4Evaluation of constant expressions should not lead to unsigned integer wrap-aroundNoAdvisory
MISRA25_12.5The sizeof operator shall not have an operand which is a function parameter declared as "array of type"YesMandatory
MISRA25_12.612.6 Structure and union members of atomic objects shall not be directly accessedYesRequired
MISRA25_13.113.1 Initializer lists shall not contain persistent side effectsYesRequired
MISRA25_13.2The value of an expression and its persistent side effects shall be the same under all permitted evaluation orders and shall be independent from thread interleavingNoRequired
MISRA25_13.313.3 A full expression containing an increment (++) or decrement (--) operator should have no other potential side effects other than that caused by the increment or decrement operatorYesAdvisory
MISRA25_13.413.4 The result of an assignment operator should not be usedYesAdvisory
MISRA25_13.513.5 The right hand operand of a logical && or || operator shall not contain persistent side effectsYesRequired
MISRA25_13.613.6 The operand of the sizeof operator shall not contain any expression which has potential side effectsYesRequired
MISRA25_14.114.1 A loop counter shall not have essentially floating typeYesRequired
MISRA25_14.214.2 A for loop shall be well-formedYesRequired
MISRA25_14.3Controlling expressions shall not be invariantNoRequired
MISRA25_14.414.4 The controlling expression of an if statement and the controlling expression of an iteration-statement shall have essentially Boolean typeYesRequired
MISRA25_15.115.1 The goto statement should not be usedYesAdvisory
MISRA25_15.215.2 The goto statement shall jump to a label declared later in the same functionYesRequired
MISRA25_15.315.3 Any label referenced by a goto statement shall be declared in the same block, or in any block enclosing the goto statementYesRequired
MISRA25_15.415.4 There should be no more than one break or goto statement used to terminate any iteration statementYesAdvisory
MISRA25_15.515.5 A function should have a single point of exit at the endYesAdvisory
MISRA25_15.615.6 The body of an iteration-statement or a selection-statement shall be a compound-statementYesRequired
MISRA25_15.715.7 All if ... else if constructs shall be terminated with an else statementYesRequired
MISRA25_16.116.1 All switch statements shall be well-formedYesRequired
MISRA25_16.216.2 A switch label shall only be used when the most closely-enclosing compound statement is the body of a switch statementYesRequired
MISRA25_16.316.3 An unconditional break statement shall terminate every switch-clauseYesRequired
MISRA25_16.416.4 Every switch statement shall have a default labelYesRequired
MISRA25_16.516.5 A default label shall appear as either the first or the last switch label of a switch statementYesRequired
MISRA25_16.616.6 Every switch statement shall have at least two switch-clausesYesRequired
MISRA25_16.7A switch-expression shall not have essentially Boolean typeYesRequired
MISRA25_17.117.1 The features of <stdarg.h> shall not be usedYesRequired
MISRA25_17.217.2 Functions shall not call themselves, either directly or indirectlyYesRequired
MISRA25_17.317.3 A function shall not be declared implicitlyYesMandatory
MISRA25_17.4All exit paths from a function with non-void return type shall have an explicit return statement with an expressionYesMandatory
MISRA25_17.517.5 The function argument corresponding to a parameter declared to have an array type shall have an appropriate number of elementsYesRequired
MISRA25_17.7The value returned by a function having non-void return type shall be usedYesRequired
MISRA25_17.817.8 A function parameter should not be modifiedYesAdvisory
MISRA25_17.9A function declared with a _Noreturn function specifier shall not return to its callerYesMandatory
MISRA25_17.1017.10 A function declared with a _Noreturn function specifier shall have void return typeYesRequired
MISRA25_17.1117.11 A function that never returns should be declared with a _Noreturn function specifierYesAdvisory
MISRA25_17.1217.12 A function identifier should only be used with either a preceding &, or with a parenthesized parameter listYesAdvisory
MISRA25_17.1317.13 A function type shall not be type qualifiedYesRequired
MISRA25_18.1A pointer resulting from arithmetic on a pointer operand shall address an element of the same array as that pointer operandNoRequired
MISRA25_18.218.2 Subtraction between pointers shall only be applied to pointers that address elements of the same arrayYesRequired
MISRA25_18.318.3 The relational operators >, >=, < and <= shall not be applied to expressions of pointer type except where they point into the same objectYesRequired
MISRA25_18.418.4 The +, -, += and -= operators should not be applied to an expression of pointer typeYesAdvisory
MISRA25_18.518.5 Declarations should contain no more than two levels of pointer nestingYesAdvisory
MISRA25_18.618.6 The address of an object with automatic or thread-local storage shall not be copied to another object that persists after the first object has ceased to existYesRequired
MISRA25_18.718.7 Flexible array members shall not be declaredYesRequired
MISRA25_18.818.8 Variable-length arrays shall not be usedYesRequired
MISRA25_18.918.9 An object with temporary lifetime shall not undergo array-to-pointer conversionYesRequired
MISRA25_18.1018.10 Pointers to variably-modified array types shall not be usedYesMandatory
MISRA25_19.1An object shall not be assigned or copied to an overlapping objectNoMandatory
MISRA25_19.219.2 The union keyword should not be usedYesAdvisory
MISRA25_20.120.1 #include directives shall only be preceded by preprocessor directives or commentsYesAdvisory
MISRA25_20.2 character sequences shall not occur in a header file nameYesRequired
MISRA25_20.3The #include directive shall be followed by either a <filename> or "filename" sequenceYesRequired
MISRA25_20.420.4 A macro shall not be defined with the same name as a keywordYesRequired
MISRA25_20.520.5 #undef should not be usedYesAdvisory
MISRA25_20.620.6 Tokens that look like a preprocessing directive shall not occur within a macro argumentYesRequired
MISRA25_20.7Expressions resulting from the expansion of macro parameters shall be appropriately delimitedNoRequired
MISRA25_20.8The controlling expression of a #if or #elif preprocessing directive shall evaluate to 0 or 1NoRequired
MISRA25_20.9All identifiers used in the controlling expression of #if or #elif preprocessing directives shall be #define'd before evaluationNoRequired
MISRA25_20.1020.10 The # and ## preprocessor operators should not be usedYesAdvisory
MISRA25_20.1120.11 A macro parameter immediately following a # operator shall not immediately be followed by a ## operatorYesRequired
MISRA25_20.12A macro parameter used as an operand to the # or ## operators, which is itself subject to further macro replacement, shall only be used as an operand to these operatorsNoRequired
MISRA25_20.1320.13 A line whose first token is # shall be a valid preprocessing directiveYesRequired
MISRA25_20.14All #else, #elif and #endif preprocessor directives shall reside in the same file as the #if, #ifdef or #ifndef directive to which they are relatedYesRequired
MISRA25_20.1520.15 #define and #undef shall not be used on a reserved identifier or reserved macro nameYesRequired
MISRA25_21.321.3 The memory allocation and deallocation functions of <stdlib.h> shall not be usedYesRequired
MISRA25_21.421.4 The standard header file <setjmp.h> shall not be usedYesRequired
MISRA25_21.521.5 The standard header file <signal.h> shall not be usedYesRequired
MISRA25_21.6output functions shall not be usedYesRequired
MISRA25_21.721.7 The atof, atoi, atol and atoll functions of <stdlib.h> shall not be usedYesRequired
MISRA25_21.8The Standard Library termination functions of <stdlib.h> shall not be usedYesRequired
MISRA25_21.921.9 The Standard Library functions bsearch and qsort of <stdlib.h> shall not be usedYesRequired
MISRA25_21.1021.10 The Standard Library time and date functions shall not be usedYesRequired
MISRA25_21.1121.11 The standard header file <tgmath.h> shall not be usedYesRequired
MISRA25_21.1221.12 The standard header file <fenv.h> shall not be usedYesRequired
MISRA25_21.1321.13 Any value passed to a function in <ctype.h> shall be representable as an unsigned char or be the value EOFYesMandatory
MISRA25_21.1421.14 The Standard Library function memcmp shall not be used to compare null terminated stringsYesRequired
MISRA25_21.15The pointer arguments to the Standard Library functions memcpy, memmove and memcmp shall be pointers to qualified or unqualified versions of compatible typesYesRequired
MISRA25_21.16The pointer arguments to the Standard Library function memcmp shall point to either a pointer type, an essentially signed type, an essentially unsigned type, an essentially Boolean type or an essentially enum typeYesRequired
MISRA25_21.1721.17 Use of the string handling functions from <string.h> shall not result in accesses beyond the bounds of the objects referenced by their pointer parametersYesMandatory
MISRA25_21.18The size_t argument passed to any function in <string.h> shall have an appropriate valueYesMandatory
MISRA25_21.1921.19 The pointers returned by the Standard Library functions localeconv, getenv, setlocale or strerror shall only be used as if they have pointer to const-qualified typeYesMandatory
MISRA25_21.2021.20 The pointer returned by the Standard Library functions asctime, ctime, gmtime, localtime, localeconv, getenv, setlocale or strerror shall not be used following a subsequent call to the same functionYesMandatory
MISRA25_21.2121.21 The Standard Library function system of <stdlib.h> shall not be usedYesRequired
MISRA25_21.2221.22 All operand arguments to any type-generic macros declared in <tgmath.h> shall have an appropriate essential typeYesMandatory
MISRA25_21.2321.23 All operand arguments to any multi-argument type-generic macros declared in <tgmath.h> shall have the same standard typeYesRequired
MISRA25_21.2421.24 The random number generator functions of <stdlib.h> shall not be usedYesRequired
MISRA25_21.2521.25 All memory synchronization operations shall be executed in sequentially consistent orderYesRequired
MISRA25_21.2621.26 The Standard Library function mtx_timedlock() shall only be invoked on mutex objects of appropriate mutex typeYesRequired
MISRA25_22.1All resources obtained dynamically by means of Standard Library functions shall be explicitly releasedYesRequired
MISRA25_22.2A block of memory shall only be freed if it was allocated by means of a Standard Library functionYesMandatory
MISRA25_22.322.3 The same file shall not be open for read and write access at the same time on different streamsYesRequired
MISRA25_22.422.4 There shall be no attempt to write to a stream which has been opened as read-onlyYesMandatory
MISRA25_22.522.5 A pointer to a FILE object shall not be dereferencedYesMandatory
MISRA25_22.6The value of a pointer to a FILE shall not be used after the associated stream has been closedNoMandatory
MISRA25_22.722.7 The macro EOF shall only be compared with the unmodified return value from any Standard Library function capable of returning EOFYesRequired
MISRA25_22.822.8 The value of errno shall be set to zero prior to a call to an errno-setting-functionYesRequired
MISRA25_22.922.9 The value of errno shall be tested against zero after calling an errno-setting-functionYesRequired
MISRA25_22.1022.10 The value of errno shall only be tested when the last function to be called was an errno-setting-functionYesRequired
MISRA25_22.1122.11 A thread that was previously either joined or detached shall not be subsequently joined nor detachedYesRequired
MISRA25_22.1222.12 Thread objects, thread synchronization objects, and thread-specific storage pointers shall only be accessed by the appropriate Standard Library functionsYesMandatory
MISRA25_22.1322.13 Thread objects, thread synchronization objects and thread-specific storage pointers shall have appropriate storage durationYesRequired
MISRA25_22.1422.14 Thread synchronization objects shall be initialized before being accessedNoMandatory
MISRA25_22.1522.15 Thread synchronization objects and thread-specific storage pointers shall not be destroyed until after all threads accessing them have terminatedYesRequired
MISRA25_22.1622.16 All mutex objects locked by a thread shall be explicitly unlocked by the same threadYesRequired
MISRA25_22.1722.17 No thread shall unlock a mutex or call cnd_wait() or cnd_timedwait() for a mutex it has not locked beforeYesRequired
MISRA25_22.1822.18 Non-recursive mutexes shall not be recursively lockedYesRequired
MISRA25_22.1922.19 A condition variable shall be associated with at most one mutex objectYesRequired
MISRA25_22.2022.20 Thread-specific storage pointers shall be created before being accessedNoMandatory
MISRA25_23.123.1 A generic selection should only be expanded from a macroYesAdvisory
MISRA25_23.2A generic selection that is not expanded from a macro shall not contain potential side effects in the controlling expressionYesRequired
MISRA25_23.323.3 A generic selection should contain at least one non-default associationYesAdvisory
MISRA25_23.4A generic association shall list an appropriate typeNoRequired
MISRA25_23.5A generic selection should not depend on implicit pointer type conversionNoAdvisory
MISRA25_23.6The controlling expression of a generic selection shall have an essential type that matches its standard typeNoRequired
MISRA25_23.723.7 A generic selection that is expanded from a macro should evaluate its argument only onceYesAdvisory
MISRA25_23.823.8 A default association shall appear as either the first or the last association of a generic selectionYesRequired
MISRA25_DIR_1.1Directive 1.1 Any implementation-defined behaviour on which the output of the program depends shall be documented and understoodNoRequired
MISRA25_DIR_1.2Directive 1.2 The use of language extensions should be minimizedNoAdvisory
MISRA25_DIR_2.1Directive 2.1 All source files shall compile without any compilation errorsYesRequired
MISRA25_DIR_3.1Directive 3.1 All code shall be traceable to documented requirementsNoRequired
MISRA25_DIR_4.1Directive 4.1 Run-time failures shall be minimizedNoRequired
MISRA25_DIR_4.2Directive 4.2 All usage of assembly language should be documentedNoAdvisory
MISRA25_DIR_4.3Directive 4.3 Assembly language shall be encapsulated and isolatedNoRequired
MISRA25_DIR_4.4Directive 4.4 Sections of code should not be "commented out"YesAdvisory
MISRA25_DIR_4.5Directive 4.5 Identifiers in the same name space with overlapping visibility should be typographically unambiguousYesAdvisory
MISRA25_DIR_4.6Directive 4.6 typedefs that indicate size and signedness should be used in place of the basic integer typesYesAdvisory
MISRA25_DIR_4.7Directive 4.7 If a function returns error information, then that error information shall be testedNoRequired
MISRA25_DIR_4.8Directive 4.8 If a pointer to a structure or union is never dereferenced within a translation unit, then the implementation of the object should be hiddenYesAdvisory
MISRA25_DIR_4.9Directive 4.9 A function should be used in preference to a function-like macro where they are interchangeableNoAdvisory
MISRA25_DIR_4.10Directive 4.10 Precautions shall be taken in order to prevent the contents of a header file being included more than onceYesRequired
MISRA25_DIR_4.11Directive 4.11 The validity of values passed to library functions shall be checkedNoRequired
MISRA25_DIR_4.12Directive 4.12 Dynamic memory allocation shall not be usedYesRequired
MISRA25_DIR_4.13Directive 4.13 Functions which are designed to provide operations on a resource should be called in an appropriate sequenceNoAdvisory
MISRA25_DIR_4.14Directive 4.14 The validity of values received from external sources shall be checkedYesRequired
MISRA25_DIR_4.15Directive 4.15 Evaluation of floating-point expressions shall not lead to the undetected generation of infinities and NaNsNoRequired
MISRA25_DIR_5.1Directive 5.1 There shall be no data races between threadsNoRequired
MISRA25_DIR_5.2Directive 5.2 There shall be no deadlocks between threadsNoRequired
MISRA25_DIR_5.3Directive 5.3 There shall be no dynamic thread creationYesRequired