MISRA C и MISRA C++ - это стандарты разработки программного обеспечения, созданные организацией MISRA (Motor Industry Software Reliability Association). Цель стандартов - улучшить безопасность, переносимость и надежность программ для встраиваемых систем.
Анализатор ориентирован на последние версии стандартов: MISRA C:2012 и MISRA C++:2008.
Error Code | Error Description | ASVS Requirement |
V2501 | Octal constants should not be used. | |
V2502 | The 'goto' statement should not be used. | |
V2503 | Implicitly specified enumeration constants should be unique – consider specifying non-unique constants explicitly. | |
V2504 | Size of an array is not specified. | |
V2505 | The 'goto' statement shouldn't jump to a label declared earlier. | |
V2506 | A function should have a single point of exit at the end. | |
V2507 | The body of a loop\conditional statement should be enclosed in braces. | |
V2508 | The function with the 'atof/atoi/atoll/atoll' name should not be used. | |
V2509 | The function with the 'abort/exit/getenv/system' name should not be used. | |
V2510 | The function with the 'qsort/bsearch' name should not be used. | |
V2511 | Memory allocation and deallocation functions should not be used. | |
V2512 | The macro with the 'setjmp' name and the function with the 'longjmp' name should not be used. | |
V2513 | Unbounded functions performing string operations should not be used. | |
V2514 | Unions should not be used. | |
V2515 | Declaration should contain no more than two levels of pointer nesting. | |
V2516 | The 'if' ... 'else if' construct should be terminated with an 'else' statement. | |
V2517 | Literal suffixes should not contain lowercase characters. | |
V2518 | The 'default' label should be either the first or the last label of a 'switch' statement. | |
V2519 | Every 'switch' statement should have a 'default' label, which, in addition to the terminating 'break' statement, should contain either a statement or a comment. | |
V2520 | Every switch-clause should be terminated by an unconditional 'break' or 'throw' statement. | |
V2521 | Only the first member of enumerator list should be explicitly initialized, unless all members are explicitly initialized. | |
V2522 | The 'switch' statement should have 'default' as the last label. | |
V2523 | All integer constants of unsigned type should have 'u' or 'U' suffix. | |
V2524 | A switch-label should only appear at the top level of the compound statement forming the body of a 'switch' statement. | |
V2525 | Every 'switch' statement should contain non-empty switch-clauses. | |
V2526 | The functions from time.h/ctime should not be used. | |
V2527 | A switch-expression should not have Boolean type. Consider using of 'if-else' construct. | |
V2528 | The comma operator should not be used. | |
V2529 | Any label should be declared in the same block as 'goto' statement or in any block enclosing it. | |
V2530 | Any loop should be terminated with no more than one 'break' or 'goto' statement. | |
V2531 | Expression of essential type 'foo' should not be explicitly cast to essential type 'bar'. | |
V2532 | String literal should not be assigned to object unless it has type of pointer to const-qualified char. | |
V2533 | C-style and functional notation casts should not be performed. | |
V2534 | The loop counter should not have floating-point type. | |
V2535 | Unreachable code should not be present in the project. | |
V2536 | Function should not contain labels not used by any 'goto' statements. | |
V2537 | Functions should not have unused parameters. | |
V2538 | The value of uninitialized variable should not be used. | |
V2539 | Class destructor should not exit with an exception. | |
V2540 | Arrays should not be partially initialized. | |
V2541 | Function should not be declared implicitly. | |
V2542 | Function with a non-void return type should return a value from all exit paths. | |
V2543 | Value of the essential character type should be used appropriately in the addition/subtraction operations. | |
V2544 | The values used in expressions should have appropriate essential types. | |
V2545 | Conversion between pointers of different object types should not be performed. | |
V2546 | Expression resulting from the macro expansion should be surrounded by parentheses. | |
V2547 | The return value of non-void function should be used. | |
V2548 | The address of an object with local scope should not be passed out of its scope. | |
V2549 | Pointer to FILE should not be dereferenced. | |
V2550 | Floating-point values should not be tested for equality or inequality. | |
V2551 | Variable should be declared in a scope that minimizes its visibility. | |
V2552 | Expressions with enum underlying type should have values corresponding to the enumerators of the enumeration. | |
V2553 | Unary minus operator should not be applied to an expression of the unsigned type. | |
V2554 | Expression containing increment (++) or decrement (--) should not have other side effects. | |
V2555 | Incorrect shifting expression. | |
V2556 | Use of a pointer to FILE when the associated stream has already been closed. | |
V2557 | Operand of sizeof() operator should not have other side effects. | |
V2558 | A pointer/reference parameter in a function should be declared as pointer/reference to const if the corresponding object was not modified. | |
V2559 | Subtraction, >, >=, <, <= should be applied only to pointers that address elements of the same array. | |
V2560 | There should be no user-defined variadic functions. | |
V2561 | The result of an assignment expression should not be used. | |
V2562 | Expressions with pointer type should not be used in the '+', '-', '+=' and '-=' operations. | |
V2563 | Array indexing should be the only form of pointer arithmetic and it should be applied only to objects defined as an array type. | |
V2564 | There should be no implicit integral-floating conversion. | |
V2565 | A function should not call itself either directly or indirectly. | |
V2566 | Constant expression evaluation should not result in an unsigned integer wrap-around. | |
V2567 | Cast should not remove 'const' / 'volatile' qualification from the type that is pointed to by a pointer or a reference. | |
V2568 | Both operands of an operator should be of the same type category. | |
V2569 | The 'operator &&', 'operator ||', 'operator ,' and the unary 'operator &' should not be overloaded. | |
V2570 | Operands of the logical '&&' or the '||' operators, the '!' operator should have 'bool' type. | |
V2571 | Conversions between pointers to objects and integer types should not be performed. | |
V2572 | Value of the expression should not be converted to the different essential type or the narrower essential type. | |
V2573 | Identifiers that start with '__' or '_[A-Z]' are reserved. | |
V2574 | Functions should not be declared at block scope. | |
V2575 | The global namespace should only contain 'main', namespace declarations and 'extern "C"' declarations. | |
V2576 | The identifier 'main' should not be used for a function other than the global function 'main'. |