Классификация предупреждений PVS-Studio согласно стандартам: MISRA C, MISRA C++

MISRA C и MISRA C++ - это стандарты разработки программного обеспечения, созданные организацией MISRA (Motor Industry Software Reliability Association). Цель стандартов - улучшить безопасность, переносимость и надежность программ для встраиваемых систем.

Анализатор ориентирован на последние версии стандартов: MISRA C:2012 и MISRA C++:2008.

C/C++ диагностики

Error CodeError DescriptionASVS Requirement
V2501Octal constants should not be used.MISRA-C-7.1, MISRA-CPP-2.13.2
V2502The 'goto' statement should not be used.MISRA-C-15.1
V2503Implicitly specified enumeration constants should be unique – consider specifying non-unique constants explicitly.MISRA-C-8.12
V2504Size of an array is not specified.MISRA-C-8.11, MISRA-CPP-3.1.3
V2505The 'goto' statement shouldn't jump to a label declared earlier.MISRA-C-15.2, MISRA-CPP-6.6.2
V2506A function should have a single point of exit at the end.MISRA-C-15.5, MISRA-CPP-6.6.5
V2507The body of a loop\conditional statement should be enclosed in braces.MISRA-C-15.6, MISRA-CPP-6.3.1, MISRA-CPP-6.4.1
V2508The function with the 'atof/atoi/atoll/atoll' name should not be used.MISRA-C-21.7, MISRA-CPP-18.0.2
V2509The function with the 'abort/exit/getenv/system' name should not be used.MISRA-C-21.8, MISRA-CPP-18.0.3
V2510The function with the 'qsort/bsearch' name should not be used.MISRA-C-21.9
V2511Memory allocation and deallocation functions should not be used.MISRA-C-21.3, MISRA-CPP-18.4.1
V2512The macro with the 'setjmp' name and the function with the 'longjmp' name should not be used.MISRA-C-21.4, MISRA-CPP-17.0.5
V2513Unbounded functions performing string operations should not be used.MISRA-CPP-18.0.5
V2514Unions should not be used.MISRA-C-19.2, MISRA-CPP-9.5.1
V2515Declaration should contain no more than two levels of pointer nesting.MISRA-C-18.5, MISRA-CPP-5.0.19
V2516The 'if' ... 'else if' construct should be terminated with an 'else' statement.MISRA-C-15.7, MISRA-CPP-6.4.2
V2517Literal suffixes should not contain lowercase characters.MISRA-C-7.3, MISRA-CPP-2.13.4
V2518The 'default' label should be either the first or the last label of a 'switch' statement.MISRA-C-16.5
V2519Every 'switch' statement should have a 'default' label, which, in addition to the terminating 'break' statement, should contain either a statement or a comment.MISRA-C-16.4
V2520Every switch-clause should be terminated by an unconditional 'break' or 'throw' statement.MISRA-C-16.3, MISRA-CPP-6.4.5
V2521Only the first member of enumerator list should be explicitly initialized, unless all members are explicitly initialized.MISRA-CPP-8.5.3
V2522The 'switch' statement should have 'default' as the last label.MISRA-CPP-6.4.6
V2523All integer constants of unsigned type should have 'u' or 'U' suffix.MISRA-C-7.2, MISRA-CPP-2.13.3
V2524A switch-label should only appear at the top level of the compound statement forming the body of a 'switch' statement.MISRA-C-16.2, MISRA-CPP-6.4.4
V2525Every 'switch' statement should contain non-empty switch-clauses.MISRA-C-16.6, MISRA-CPP-6.4.8
V2526The functions from time.h/ctime should not be used.MISRA-C-21.10, MISRA-CPP-18.0.4
V2527A switch-expression should not have Boolean type. Consider using of 'if-else' construct.MISRA-C-16.7, MISRA-CPP-6.4.7
V2528The comma operator should not be used.MISRA-C-12.3, MISRA-CPP-5.18.1
V2529Any label should be declared in the same block as 'goto' statement or in any block enclosing it.MISRA-C-15.3, MISRA-CPP-6.6.1
V2530Any loop should be terminated with no more than one 'break' or 'goto' statement.MISRA-C-15.4, MISRA-CPP-6.6.4
V2531Expression of essential type 'foo' should not be explicitly cast to essential type 'bar'.MISRA-C-10.5
V2532String literal should not be assigned to object unless it has type of pointer to const-qualified char.MISRA-C-7.4
V2533C-style and functional notation casts should not be performed.MISRA-CPP-5.2.4
V2534The loop counter should not have floating-point type.MISRA-C-14.1, MISRA-CPP-6.5.1
V2535Unreachable code should not be present in the project.MISRA-C-2.1, MISRA-CPP-0.1.1
V2536Function should not contain labels not used by any 'goto' statements.MISRA-C-2.6
V2537Functions should not have unused parameters.MISRA-C-2.7, MISRA-CPP-0.1.11
V2538The value of uninitialized variable should not be used.MISRA-C-9.1, MISRA-CPP-8.5.1
V2539Class destructor should not exit with an exception.MISRA-CPP-15.5.1
V2540Arrays should not be partially initialized.MISRA-C-9.3
V2541Function should not be declared implicitly.MISRA-C-17.3
V2542Function with a non-void return type should return a value from all exit paths.MISRA-C-17.4, MISRA-CPP-8.4.3
V2543Value of the essential character type should be used appropriately in the addition/subtraction operations.MISRA-C-10.2
V2544The values used in expressions should have appropriate essential types.MISRA-C-10.1
V2545Conversion between pointers of different object types should not be performed.MISRA-C-11.3
V2546Expression resulting from the macro expansion should be surrounded by parentheses.MISRA-C-20.7, MISRA-CPP-16.0.6
V2547The return value of non-void function should be used.MISRA-C-17.7, MISRA-CPP-0.1.7
V2548The address of an object with local scope should not be passed out of its scope.MISRA-C-18.6, MISRA-CPP-7.5.2
V2549Pointer to FILE should not be dereferenced.MISRA-C-22.5
V2550Floating-point values should not be tested for equality or inequality.MISRA-CPP-6.2.2
V2551Variable should be declared in a scope that minimizes its visibility.MISRA-CPP-3.4.1
V2552Expressions with enum underlying type should have values corresponding to the enumerators of the enumeration.MISRA-CPP-7.2.1
V2553Unary minus operator should not be applied to an expression of the unsigned type.MISRA-CPP-5.3.2
V2554Expression containing increment (++) or decrement (--) should not have other side effects.MISRA-C-13.3, MISRA-CPP-5.2.10
V2555Incorrect shifting expression.MISRA-C-12.2, MISRA-CPP-5.8.1
V2556Use of a pointer to FILE when the associated stream has already been closed.MISRA-C-22.6
V2557Operand of sizeof() operator should not have other side effects.MISRA-C-13.6, MISRA-CPP-5.3.4
V2558A pointer/reference parameter in a function should be declared as pointer/reference to const if the corresponding object was not modified.MISRA-CPP-7.1.2
V2559Subtraction, >, >=, <, <= should be applied only to pointers that address elements of the same array.MISRA-CPP-5.0.17, MISRA-CPP-5.0.18
V2560There should be no user-defined variadic functions.MISRA-CPP-8.4.1
V2561The result of an assignment expression should not be used.MISRA-C-13.4, MISRA-CPP-6.2.1
V2562Expressions with pointer type should not be used in the '+', '-', '+=' and '-=' operations.MISRA-C-18.4
V2563Array indexing should be the only form of pointer arithmetic and it should be applied only to objects defined as an array type.MISRA-CPP-5.0.15
V2564There should be no implicit integral-floating conversion.MISRA-CPP-5.0.5
V2565A function should not call itself either directly or indirectly.MISRA-C-17.2, MISRA-CPP-7.5.4
V2566Constant expression evaluation should not result in an unsigned integer wrap-around.MISRA-C-12.4, MISRA-CPP-5.19.1
V2567Cast should not remove 'const' / 'volatile' qualification from the type that is pointed to by a pointer or a reference.MISRA-C-11.8, MISRA-CPP-5.2.5
V2568Both operands of an operator should be of the same type category.MISRA-C-10.4
V2569The 'operator &&', 'operator ||', 'operator ,' and the unary 'operator &' should not be overloaded.MISRA-CPP-5.2.11, MISRA-CPP-5.3.3
V2570Operands of the logical '&&' or the '||' operators, the '!' operator should have 'bool' type.MISRA-CPP-5.3.1
V2571Conversions between pointers to objects and integer types should not be performed.MISRA-C-11.4, MISRA-C-11.5, MISRA-CPP-5.2.8, MISRA-CPP-5.2.9
V2572Value of the expression should not be converted to the different essential type or the narrower essential type.MISRA-C-10.3
V2573Identifiers that start with '__' or '_[A-Z]' are reserved.MISRA-C-21.2, MISRA-C-21.1, MISRA-CPP-17.0.1
V2574Functions should not be declared at block scope.MISRA-CPP-3.1.2
V2575The global namespace should only contain 'main', namespace declarations and 'extern "C"' declarations.MISRA-CPP-7.3.1
V2576The identifier 'main' should not be used for a function other than the global function 'main'.MISRA-CPP-7.3.2

Найденные ошибки

Проверено проектов
427
Собрано ошибок
14 526

А ты совершаешь ошибки в коде?

Проверь с помощью
PVS-Studio

Статический анализ
кода для C, C++, C#
и Java

goto PVS-Studio;
Этот сайт использует куки и другие технологии, чтобы предоставить вам более персонализированный опыт. Продолжая просмотр страниц нашего веб-сайта, вы принимаете условия использования этих файлов. Если вы не хотите, чтобы ваши данные обрабатывались, пожалуйста, покиньте данный сайт. Подробнее →
Принять