Классификация предупреждений PVS-Studio согласно AUTOSAR C++14 Coding Guidelines

The AUTOSAR C++14 Coding Guidelines - это набор руководств для написания кода на языке C++14, который предназначен для работы в системах, в которых важны безопасность и отказоустойчивость. Этот документ является обновлением стандарта MISRA C++:2008, а также основан на других ведущих стандартах написания кода и исследованиях, проделанных AUTOSAR. Основной сферой применения данного документа является автомобильная промышленность, но он также может быть использован и в других отраслях, занимающихся разработкой встраиваемых систем.

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

Error CodeError DescriptionASVS Requirement
V2501Octal constants should not be used.AUTOSAR-M2.13.2
V2504Size of an array is not specified.AUTOSAR-A3.1.4
V2505The 'goto' statement shouldn't jump to a label declared earlier.AUTOSAR-M6.6.2
V2507The body of a loop\conditional statement should be enclosed in braces.AUTOSAR-M6.3.1, AUTOSAR-M6.4.1
V2508The function with the 'atof/atoi/atoll/atoll' name should not be used.AUTOSAR-A18.0.2
V2509The function with the 'abort/exit/getenv/system' name should not be used.AUTOSAR-M18.0.3
V2512The macro with the 'setjmp' name and the function with the 'longjmp' name should not be used.AUTOSAR-M17.0.5
V2513Unbounded functions performing string operations should not be used.AUTOSAR-M18.0.5
V2514Unions should not be used.AUTOSAR-M9.5.1
V2515Declaration should contain no more than two levels of pointer nesting.AUTOSAR-A5.0.3
V2516The 'if' ... 'else if' construct should be terminated with an 'else' statement.AUTOSAR-M6.4.2
V2517Literal suffixes should not contain lowercase characters.AUTOSAR-M2.13.4
V2520Every switch-clause should be terminated by an unconditional 'break' or 'throw' statement.AUTOSAR-M6.4.5
V2522The 'switch' statement should have 'default' as the last label.AUTOSAR-M6.4.6
V2523All integer constants of unsigned type should have 'u' or 'U' suffix.AUTOSAR-M2.13.3
V2524A switch-label should only appear at the top level of the compound statement forming the body of a 'switch' statement.AUTOSAR-M6.4.4
V2526The functions from time.h/ctime should not be used.AUTOSAR-M18.0.4
V2527A switch-expression should not have Boolean type. Consider using of 'if-else' construct.AUTOSAR-M6.4.7
V2528The comma operator should not be used.AUTOSAR-M5.18.1
V2529Any label should be declared in the same block as 'goto' statement or in any block enclosing it.AUTOSAR-M6.6.1
V2534The loop counter should not have floating-point type.AUTOSAR-A6.5.2
V2535Unreachable code should not be present in the project.AUTOSAR-M0.1.1
V2537Functions should not have unused parameters.AUTOSAR-M0.1.11
V2538The value of uninitialized variable should not be used.AUTOSAR-M8.5.1
V2542Function with a non-void return type should return a value from all exit paths.AUTOSAR-A8.4.2
V2546Expression resulting from the macro expansion should be surrounded by parentheses.AUTOSAR-M16.0.6
V2547The return value of non-void function should be used.AUTOSAR-A0.1.2
V2548The address of an object with local scope should not be passed out of its scope.AUTOSAR-M7.5.2
V2550Floating-point values should not be tested for equality or inequality.AUTOSAR-M6.2.2
V2551Variable should be declared in a scope that minimizes its visibility.AUTOSAR-M3.4.1
V2552Expressions with enum underlying type should have values corresponding to the enumerators of the enumeration.AUTOSAR-A7.1.2
V2553Unary minus operator should not be applied to an expression of the unsigned type.AUTOSAR-M5.3.2
V2554Expression containing increment (++) or decrement (--) should not have other side effects.AUTOSAR-M5.2.10
V2555Incorrect shifting expression.AUTOSAR-M5.8.1
V2557Operand of sizeof() operator should not have other side effects.AUTOSAR-M5.3.4
V2558A pointer/reference parameter in a function should be declared as pointer/reference to const if the corresponding object was not modified.AUTOSAR-M7.1.2
V2559Subtraction, >, >=, <, <= should be applied only to pointers that address elements of the same array.AUTOSAR-M5.0.18, AUTOSAR-M5.0.17
V2561The result of an assignment expression should not be used.AUTOSAR-M6.2.1
V2563Array indexing should be the only form of pointer arithmetic and it should be applied only to objects defined as an array type.AUTOSAR-M5.0.15
V2564There should be no implicit integral-floating conversion.AUTOSAR-M5.0.5
V2565A function should not call itself either directly or indirectly.AUTOSAR-A7.5.1
V2566Constant expression evaluation should not result in an unsigned integer wrap-around.AUTOSAR-M5.19.1
V2567Cast should not remove 'const' / 'volatile' qualification from the type that is pointed to by a pointer or a reference.AUTOSAR-A5.2.3
V2569The 'operator &&', 'operator ||', 'operator ,' and the unary 'operator &' should not be overloaded.AUTOSAR-M5.2.11, AUTOSAR-M5.3.3
V2570Operands of the logical '&&' or the '||' operators, the '!' operator should have 'bool' type.AUTOSAR-M5.3.1
V2571Conversions between pointers to objects and integer types should not be performed.AUTOSAR-M5.2.8, AUTOSAR-M5.2.9
V2573Identifiers that start with '__' or '_[A-Z]' are reserved.AUTOSAR-A17.0.1

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

Проверено проектов
412
Собрано ошибок
14 132

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

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

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

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