EN JP CN

MISRA-C 2004 checker reference

These checkers detect violations of the MISRA C 2004 standard.

Notes

Issue codeDescriptionMISRA-C RuleIssuedImproved

FUNCRET.GEN

Non-void function does not return value16.8Pre-9.2 

FUNCRET.IMPLICIT

Non-void function implicitly returning int does not return value16.8Pre-9.2 

INVARIANT_CONDITION.GEN

Invariant expression in a condition13.710.110.2

INVARIANT_CONDITION.UNREACH

Invariant expression in a condition13.710.110.2

LOCRET.ARG

Function returns address of local variable17.6Pre-9.29.5

LOCRET.GLOB

Function returns address of local variable17.6Pre-9.29.5

LOCRET.RET

Function returns address of local variable17.6Pre-9.29.5

MISRA.ASM.ENCAPS

Assembly language is not isolated.2.19.1 

MISRA.ASSIGN.COND

Assignment operator is used in a condition13.19.2 

MISRA.ASSIGN.OVERLAP

Object is assigned to an overlapping object18.29.5 

MISRA.BITFIELD.SIGNED

Length of a named signed bit-field is less than 26.59.19.2, 10.4

MISRA.BITFIELD.SIGNED.UNNAMED

Length of an unnamed signed bit-field is less than 26.59.2 

MISRA.BITFIELD.TYPE

Type of bit-field is not signed/unsigned integer6.49.19.2, 11.0

MISRA.BITS.NOT_UNSIGNED

Operand of bitwise operation is not unsigned integer12.79.19.2, 9.2 SR1, 9.5, 11.0

MISRA.BITS.NOT_UNSIGNED.PREP

Operand of bitwise operation is not unsigned integer12.711.1 

MISRA.BUILTIN_NUMERIC

Builtin numeric type is used6.39.19.2, 9.2 SR1, 9.5

MISRA.CAST.CONST

Cast operation removes const or volatile modifier from a pointer or reference11.59.19.2, 10.4

MISRA.CAST.FLOAT

Non-trivial float expression is cast to a wider type10.49.19.2

MISRA.CAST.FUNC_PTR

Cast between a function pointer and a non-integral type11.19.19.2

MISRA.CAST.INT

Non-trivial integer expression is cast to a wider type, or type with a different signedness10.39.19.2, 9.5

MISRA.CAST.PTR

Cast between a pointer to object type and a different pointer to object type11.49.1 

MISRA.CAST.PTR.UNRELATED

Object of pointer type cast to unrelated type11.29.29.5

MISRA.CAST.PTR_TO_INT

Cast between a pointer and an integral type11.39.19.2

MISRA.CAST.UNSIGNED_BITS

The result of bitwise operation on unsigned char or short is not cast back to original type10.59.1 

MISRA.CHAR.NOT_CHARACTER

'char' is used for non-character value6.19.111.2

MISRA.CHAR.TRIGRAPH

Trigraph usage4.29.19.2

MISRA.COMMA

Comma operator is used12.109.1 

MISRA.COMP.WRAPAROUND

Wrap-around in a condition12.119.29.5

MISRA.CONTINUE

Continue statement is used14.59.1 

MISRA.CT.UNIQUE.ID

Identifier clashes with type name5.49.19.2, 9.2 SR1

MISRA.CVALUE.IMPL.CAST

The value of an expression implicitly converted to a different type10.1 10.29.29.5, 11.0

MISRA.DECL.ARRAY_SIZE

Declaration of array with unknown size8.129.1 

MISRA.DECL.FUNC_LOCAL

Function is declared locally8.69.19.2 SR1

MISRA.DECL.NO_TYPE

Declaration without a type8.29.19.2 SR1

MISRA.DEFINE.BADEXP

Inappropriate macro expansion19.49.19.5

MISRA.DEFINE.FUNC

Function-like macro definition19.79.1 

MISRA.DEFINE.LONGNAME

Macro name is too long5.19.1 

MISRA.DEFINE.NOPARS

Macro parameter with no parentheses19.109.1 

MISRA.DEFINE.NOTGLOBAL

Define not at the global level19.59.1 

MISRA.DEFINE.SHARP

# or ## operator in a macro definition19.139.1 

MISRA.DEFINE.SHARP.MANY

Several # or ## operators in a macro definition19.129.1 

MISRA.DEFINE.WRONGNAME

Usage of a name from the standard library for naming a macro20.19.19.2 SR2, 9.5

MISRA.DEFINE.WRONGNAME.UNDERSCORE

Usage of a reserved name for naming a macro20.19.2 SR2 

MISRA.ELIF.DEFINED

Incorrect 'defined' usage in #elif directive19.149.1 

MISRA.ELIF.OTHERFILE

#elif in an improper file19.179.1 

MISRA.ELIF.UNDEF

Undefined macros in #elif directive19.119.1 

MISRA.ELIF.WRAPAROUND

Wrap-around in #elif directive12.119.1 

MISRA.ELSE.OTHERFILE

#else in an improper file19.179.1 

MISRA.ENDIF.OTHERFILE

#endif in an improper file19.179.1 

MISRA.ENUM.INIT

Non-first enumerator is explicitly initialized, but not all elements are explicitly initialized.9.39.1 

MISRA.EXPANSION.DIRECTIVE

Directive-like tokens within a macro argument19.99.1 

MISRA.EXPANSION.NARGS

Missing macro argument19.89.19.2 SR2

MISRA.EXPANSION.UNSAFE

Unsafe macro usage20.1 20.5 20.6 20.7 20.89.19.5

MISRA.EXPR.PARENS.INSUFFICIENT

Limited dependence required for operator precedence rules in expressions12.110.1.2 

MISRA.EXPR.PARENS.REDUNDANT

Limited dependence required for operator precedence rules in expressions12.110.1.211.2

MISRA.FLOAT.BIT.REPR

Use of bit manipulations of floating-point values which rely on storage layout12.129.19.2 SR2, 11.0

MISRA.FLOAT_EQUAL

Floating point expression is tested for equality13.39.1 

MISRA.FOR.COND

For loop condition does not depend on loop counter13.59.19.2, 9.2 SR1

MISRA.FOR.COND.FLT

Floating point object is used in the condition section of a 'for' loop13.49.29.5

MISRA.FOR.INCR.CHANGE

For loop increment expression does not change loop counter13.59.1 

MISRA.FOR.STMT.CHANGE

For loop counter is modified within the loop statement13.69.2 

MISRA.FUNC.ADDR

Address of a function is used without & operator16.99.19.2 SR1

MISRA.FUNC.NOPROT.CALL

Function is called but has no prototype8.19.29.2 SR1

MISRA.FUNC.NOPROT.DEF

Function has a definition but no prototype8.19.2 

MISRA.FUNC.NO_PARAMS

Function without parameters is missing void parameter type16.59.1 

MISRA.FUNC.PARAMS.IDENT

Identifiers used in declaration and definition of function are no identical16.49.2 

MISRA.FUNC.RECUR

Recursive function16.29.19.2, 9.2 SR1

MISRA.FUNC.STATIC.REDECL

Function or object redeclaration does not include 'static' modifier8.119.2 

MISRA.FUNC.UNMATCHED.PARAMS

Number of formal and actual parameters passed to function do not match16.69.1 

MISRA.FUNC.UNNAMED.PARAMS

Function declaration has unnamed parameters16.39.1 

MISRA.FUNC.VARARG

Function with variable number of arguments16.19.1 

MISRA.GOTO

Goto statement is used14.49.1 

MISRA.IDENT.LONG

Identifier is longer than 31 characters5.19.19.2

MISRA.IF.DEFINED

Incorrect 'defined' usage in #if directive19.149.1 

MISRA.IF.NO_COMPOUND

The body of if/else statement is not a compound statement14.99.1 

MISRA.IF.NO_ELSE

A chain of if/else-if statements is not terminated with else or is terminated with an empty else clause14.109.110.4

MISRA.IF.UNDEF

Undefined macros in #if directive19.119.1 

MISRA.IF.WRAPAROUND

Wrap-around in #if directive12.119.1 

MISRA.INCGUARD

Include guard is not provided19.159.1 

MISRA.INCL.BAD

Non-standard include directive19.39.19.2, 11.1

MISRA.INCL.INSIDE

Include directive preceded by a preprocessor output token19.19.1 

MISRA.INCL.SYMS

Non-standard characters in header file names19.29.1 

MISRA.INCL.UNSAFE

Unsafe header inclusion20.1 20.12 20.8 20.99.1 

MISRA.INCOMPLETE.STRUCT

Incomplete struct type is used18.19.2 

MISRA.INCOMPLETE.STRUCT.UNNAMED

Incomplete unnamed struct type is used18.19.2 

MISRA.INCOMPLETE.UNION

Incomplete union type is used18.19.2 

MISRA.INCOMPLETE.UNION.UNNAMED

Incomplete unnamed union type is used18.19.2 

MISRA.INCR_DECR.OTHER

Increment or decrement operator is mixed with other operators in expression12.139.19.2

MISRA.INIT.BRACES

Incorrect initializer braces placement.9.29.1 

MISRA.ITER.ONETERM

Iteration statement has more than one break or goto for loop termination.14.69.1 

MISRA.LITERAL.UNSIGNED.SUFFIX

Unsigned integer literal without 'U' suffix10.69.19.5

MISRA.LOGIC.OPERAND.NOT_BOOL

Operand of logical operator is not effectively boolean12.69.19.2 SR1, 9.5

MISRA.LOGIC.OPERATOR.NOT_BOOL

Operand of non-logical operator is effectively boolean12.69.1 (for C), 9.2 SR1 (for C++)11.2

MISRA.LOGIC.PRIMARY

Operand in a logical 'and' or 'or' expression is not a primary expression12.59.2 SR2 

MISRA.LOGIC.SIDEEFF

Right operand in a logical 'and' or 'or' expression contains side effects12.49.210.4

MISRA.LOGIC.SIDEEFF.COND

Branch expression in a conditional expression contains side effects12.49.2 

MISRA.NULL.STMT

Null statement is not the only statement on line or comments are placed incorrectly14.39.19.2

MISRA.OBJ.TYPE.COMPAT

Type not compatible with type of other declaration8.49.111.0

MISRA.OBJ.TYPE.IDENT

Type not identical with type of other declaration8.39.19.2

MISRA.ONEDEFRULE.FUNC

Global function definition in a header file8.59.1 

MISRA.ONEDEFRULE.VAR

Global variable definition in a header file8.59.1 

MISRA.PPARAM.NEEDS.CONST

Pointer parameter is not used to modify the addressed object but is not declared as a pointer to const16.79.19.2 SR1, 9.5, 10.4

MISRA.PRAGMA

Non-documented pragma directive3.49.1 

MISRA.PTR.ARITH

Pointer is used in arithmetic or array index expression17.1 17.49.1 

MISRA.PTR.TO_PTR_TO_PTR

Pointer declaration has more than two levels of indirection17.59.19.2

MISRA.RETURN.NOT_LAST

Return is not the last statement in a function14.79.19.2 SR2, 9.5

MISRA.SHIFT.RANGE

Right operand of shift operation is out of range - greater or equal to max bit-length of left operand, or negative12.89.19.2

MISRA.SIGNED_CHAR.NOT_NUMERIC

'signed char' or 'unsigned char' is used for non-numeric value6.29.19.2

MISRA.SIZEOF.SIDE_EFFECT

Operand of sizeof has side effects12.39.1 

MISRA.STDLIB.ABORT

Use of 'abort', 'exit', 'getenv' or 'system' from library stdlib.h20.119.1 

MISRA.STDLIB.ATOI

Use of 'atof', 'atoi' or 'atol' from library stdlib.h20.109.1 

MISRA.STDLIB.ERRNO

Use of error indicator 'errno'20.59.1 

MISRA.STDLIB.LONGJMP

Use of setjmp macro or longjmp function20.79.1 

MISRA.STDLIB.MEMORY

Use of dynamic heap memory allocation20.49.1 

MISRA.STDLIB.SIGNAL

Use of the signal handling facilities of signal.h20.89.1 

MISRA.STDLIB.STDIO

Use of input/output library stdio.h in production code20.99.1 

MISRA.STDLIB.TIME

Use of the time handling functions of library time.h20.129.1 

MISRA.STDLIB.WRONGNAME

Reused name of standard library macro, object or function20.29.19.2 SR2

MISRA.STDLIB.WRONGNAME.UNDERSCORE

Usage of a reserved name for naming a language entity20.29.2 SR2 

MISRA.STMT.NO_COMPOUND

The body of switch, while, do/while or for statement is not a compound statement14.89.1 

MISRA.STMT.NO_EFFECT

The statement has no side effects, and does not change control flow14.29.19.2, 9.2 SR1

MISRA.SWITCH.BOOL

Condition of switch statement is boolean expression15.49.1 

MISRA.SWITCH.LABEL

A switch label belongs to nested compound statement inside switch body15.19.1 

MISRA.SWITCH.NODEFAULT

No default clause at the end of a switch statement15.39.29.2 SR1

MISRA.SWITCH.NO_BREAK

No break or throw statement at the end of switch-clause15.29.19.2

MISRA.SWITCH.NO_CASE

No case-clause in a switch statement15.59.19.2

MISRA.TOKEN.BADCOM

Inappropriate character sequence in a comment2.39.1 

MISRA.TOKEN.CPCOM

C++ style comments2.29.1 

MISRA.TOKEN.OCTAL.ESCAPE

Usage of octal escape sequences7.19.1 

MISRA.TOKEN.OCTAL.INT

Usage of octal integer constants7.19.1 

MISRA.TOKEN.WRONGESC

Incorrect escape sequence in a literal4.19.1 

MISRA.TYPE.NAMECLASH

Identifier in one name space has same spelling as identifier in other name space5.69.19.2, 9.2 SR2, 9.5

MISRA.TYPEDEF.NOT_UNIQUE

Typedef name is used for another entity5.39.19.2, 9.5

MISRA.UMINUS.UNSIGNED

Operand of unary minus is unsigned12.99.1 

MISRA.UNDEF

Undef usage19.69.1 

MISRA.UNDEF.NOTGLOBAL

Undef not at the global level19.59.1 

MISRA.UNDEF.WRONGNAME

Undefinition of a name from the standard library20.29.19.5

MISRA.UNDEF.WRONGNAME.UNDERSCORE

Undefinition of a reserved name20.29.2 SR2 

MISRA.UNION

Union is used18.49.1 

MISRA.VAR.HIDDEN

Identifier declared in an inner scope hides identifier in outer scope5.29.29.2 SR1, 9.5, 10.1

MISRA.VAR.MIN.VIS

Name visibility is too wide8.79.19.2 SR2, 10.1

MISRA.VAR.UNIQUE

Identifier clashes with other identifier5.79.29.2 SR2

MISRA.VAR.UNIQUE.STATIC

Identifier with static storage specifier clashes with other identifier5.59.2 

MISRA.ZERO_EQ.IMPLICIT

Non-boolean expression is implicitly tested against zero13.29.19.2 SR1

PORTING.VAR.EFFECTS

Variable used twice in one expression where one usage is subject to side-effects12.29.29.5

UNINIT.HEAP.MIGHT

Uninitialized Heap Use - possible9.1Pre-9.29.2, 9.5

UNINIT.HEAP.MUST

Uninitialized Heap Use9.1Pre-9.29.2, 9.5

UNINIT.STACK.ARRAY.MIGHT

Uninitialized Array - possible9.1Pre-9.29.2, 9.5

UNINIT.STACK.ARRAY.MUST

Uninitialized Array9.1Pre-9.29.2, 9.5

UNINIT.STACK.ARRAY.PARTIAL.MUST

Partialy Uninitialized Array9.1Pre-9.29.2, 9.5

UNINIT.STACK.MIGHT

Uninitialized Variable - possible9.1Pre-9.29.2, 9.5

UNINIT.STACK.MUST

Uninitialized Variable9.1Pre-9.29.2, 9.5, 11.2

UNREACH.GEN

Unreachable code14.1Pre-9.29.2, 9.5, 10.1, 10.3, 10.4, 11.2

UNREACH.RETURN

Unreachable Void Return14.1Pre-9.29.2, 9.5, 11.2

Support Summary

Total supported: 121
Total of not statically verifiable rules:15
Total of statically verifiable rules not supported: 6
MISRA C coverage:95.3% (excludes rules that are not statically verifiable)