This release includes the following enhancements:
Release date: December 13, 2023
Enhanced Automotive Compliance Pack
This release introduces complete support for the recently published MISRA C++:2023 coding guidelines.
A new MISRA C++2023 test configuration has been added to support MISRA C++:2023 coding guidelines.
This configuration enables the complete enforcement of the "Guidelines for the use of C++17 in critical systems" coding standard. The MISRA C++:2023 test configuration replaces the previously available MISRA C++ 202X test configuration containing guidelines from the "Public Review Draft of MISRA C++ 202X".
Enhanced Static Analysis
- New code analysis rules have been added to extend coverage of compliance standards. See New Rules and Updated Rules for the lists of new and updated rules.
- General enhancements to the accuracy and performance of static analysis rules.
- The syntax of in-code suppressions has been extended. It is now possible to suppress a finding in the next line. See Next Line Suppression.
Enhanced Coverage Analysis
Support for collecting code coverage for 'constexpr' functions has been added. See Support for C++ Constant Expressions and -constexpr -coverage.
Support for Compilers
The following compilers are now supported:
Compiler Name | Compiler Identifier |
---|---|
Clang C/C++ Compiler v 15.0 (x86_64) | clang_15_0-x86_64 |
Clang C/C++ Compiler v 16.0 (aarch32) | clang_16_0-aarch32 |
Clang C/C++ Compiler v 16.0 (aarch64) | clang_16_0-aarch64 |
Clang C/C++ Compiler v 16.0 (x86_64) | clang_16_0-x86_64 |
GNU GCC 13.x (aarch64) | gcc_13-aarch64 |
GNU GCC 13.x (x86_64) | gcc_13-64 |
Hexagon Clang Compiler v. 8.7.x | hexagon-clang_8_7 |
IAR BXARM v. 9.20x | iccarm_9_20 |
Smartcode for TriCore C/C++ Compiler 10.1 | smartcode_10_1-tricore |
See Compilers.
Support for IDEs
The following IDE is now supported:
- Visual Studio 2022
Two installation packages are now available, depending on the Visual Studio version:
- C/C++test for Visual Studio x86_64 (64-bit) - for Visual Studio 2022 or newer
- C/C++test for Visual Studio x86 (32-bit) - for Visual Studio 2019 or older
New and Updated Test Configurations
The following test configuration has been added:
- MISRA C++ 2023
The following test configurations have been updated with new rules:
- AUTOSAR C++14 Coding Guidelines
- CWE Top 25 + On the Cusp 2019
- CWE Top 25 + On the Cusp 2022
- CWE Top 25 2019
- CWE Top 25 2022
- Flow Analysis Aggressive
- Flow Analysis Standard
- Global Analysis
- High Integrity C++
- MISRA C 1998
- MISRA C 2023 (MISRA C 2012)
- Modern C++ (11, 14 and 17)
- Recommended Rules for FDA (C)
- Recommended Rules for FDA (C++)
- Security Rules
- SEI CERT C Guidelines
- SEI CERT C Rules
- SEI CERT C++ Rules
Additional Updates
You can now generate multiple reports in different formats simultaneously for a single analysis run.
- Report formats can be configured with the
report.format
setting in a .properties file. For details, see Configuring Settings. - The configuration setting
report.generate_htmls
is removed. Thereport.format
setting should be used to generate HTML reports. - The default report file names have changed for the following supported formats:
Report Format | Before | Now |
---|---|---|
HTML (C/C++test's Unit Testing details) | report.html | report_ut_details.html |
SARIF for Azure DevOps | report.sarif | report_azure.sarif |
SAST v14 for GitLab | report.sast | report_v14.sast |
XML SATE (Static Analysis Tool Exposition) | report_report.xml | report_sate.xml |
XSL Custom | report.html | report_custom.html |
cppUnit | report_report.xml | report_cppunit.xml |
xUnit | report_report.xml | report_xunit.xml |
- Please ensure that you update your workflows accordingly, if needed.
- For details about the report file names, see Report File Names.
Known Issues and Limitations
- For Visual Studio 2022, when specifying file paths in C/C++test's configuration files (.properties), it is strongly recommended to use absolute paths rather than relative paths. To make the configuration files shareable, you can use variables (as a part of such a file path), for example:
cpptest.custom.rules.dir=${env_var:HOME}/custom/rules
.
Deprecated and Removed Support
Removed Test Configurations
The following test configuration has been removed:
- MISRA C++ 202X
Compilers to Be Deprecated
Support for the following compilers will be deprecated in future releases:
- GNU GCC 5.x
- GNU GCC 5.x (x86_64)
- GNU GCC 6.x
- GNU GCC 6.x (x86_64)
- IAR Compiler for ARM v. 7.4x
- IAR Compiler for ARM v. 7.8x
- IAR Compiler for M16C & R8C v. 3.5x
Deprecated Compilers
Support for the following compilers is deprecated and will be removed in future releases:
- Clang C/C++ Compiler v 6.0
- FR Family Softune C/C++ Compiler V6
- Green Hills Software Compiler for ARM64 v. 2014.1.x
Green Hills Software Compiler for PPC v. 4.2.x
- Green Hills Software Compiler for PPC v. 5.0.x
- Green Hills Software Compiler for V850 v. 2014.1.x
- Microsoft Visual C++ 14.0
- Microsoft Visual C++ 14.0 (x64)
- SH Series C/C++ Compiler V.9.04.xx
- TI MSP430 C/C++ Compiler GNU GCC 6.x
- TI TMS320C2000 C/C++ Compiler v16.9
- Vx-toolset for TriCore C/C++ Compiler 6.2
- Wind River GCC 4.8.x
Removed Support for Compilers
The following compilers are no longer supported:
- C compiler for 80C196 v. 6.0 r1
- Clang C/C++ Compiler v 5.0
- Freescale C/C++ Compiler v. 5.1 for Embedded ARM
- Freescale CodeWarrior ANSI-C/cC++ Compiler 5.0.x for HC12
- FreeScale CodeWarrior ColdFire v 6.0
- GCC for Tricore 4.9.x
- Green Hills Software Compiler for ARM v. 2014.1.x
- Green Hills Software Compiler for PPC v. 4.0.x
- Green Hills Software Compiler for V850 v. 2013.5.x
- IAR Compiler for RX v. 2.5x
- IAR Compiler for RX v. 2.6x
- IAR Compiler for STM8 v. 1.4x
- TI MSP430 C/C++ Compiler v4.0
- TI TMS320C6x C/C++ Compiler v7.4
- Wind River Diab 5.7.x
- Wind River Diab 5.8.x
- Wind River GCC 3.3.x
- Wind River GCC 3.4.x
- Wind River GCC 4.1.x
- Wind River GCC 4.3.x
Resolved Bugs and FRs
Bug/FR ID | Description |
---|---|
CPP-45027 | [cli] Need a way to generate multiple reports per run (C/C++test Professional) |
CPP-46135 | [static] Improve mapping for CERT-C INT13 |
CPP-47079 | [static] Improve mapping for AUTOSAR-A9_3_1 |
CPP-47353 | [static] Split COMMENT-14 and COMMENT-14_b rules to report separately on function declarations and definitions |
CPP-47435 | [cli] Generate multiple report formats from a single test run in C/C++test Professional |
CPP-47603 | [static] Add a way to in-code suppress violation in the next line |
CPP-47674 | [engine] Add support for collecting code coverage for constexpr functions (when used in non-consteval context) |
CPP-47796 | [static] CODSTA-CPP-53 and CODSTA-CPP-43 should be extended for checking template instances |
CPP-48590 | [static] Improve mapping for CERT C ERR07-C |
CPP-49654 | [ide] Improve handling of \" sequence in the command line |
CPP-50307 | [static] Extend mapping for AUTOSAR A0-1-4 |
CPP-50659 | [ide] C/C++test Professional - support for Visual Studio 2022 IDE |
CPP-51362 | [static] Improve mapping for AUTOSAR A9-6-1 |
CPP-51442 | [engine] error: too few arguments for template template parameter "Tuple" |
CPP-51639 | [static] Add exception in AUTOSAR A7-2-5 |
CPP-52200 | [engine] error: no instance of constructor "tuple" matches the argument list |
CPP-52204 | [static] Extend mapping for AUTOSAR A27-0-4 |
CPP-52327 | [static] MISRAC2012-RULE_5_4-c/MISRAC2012-RULE_5_4-d: performance improvements |
CPP-52363 | [compiler] Support for IAR BXARM 9.20.3 |
CPP-52532 | [compiler] Support for clang 16 (aarch32) |
CPP-52566 | [static] Improve mapping for CERT-CPP-DCL60 [global] |
CPP-52600 | [static] Improve mapping for MISRA C 2012 Rule 12.1 |
CPP-52661 | [static] Implement new rule detecting when names of members are reused in derived classes |
CPP-52704 | [static] PFO-01 (MISRA2008-3_1_1) should allow inline variables in a header file |
CPP-52826 | [static] CODSTA-CPP-53 (MISRA2008-7_1_1) improved for Lambda expressions |
CPP-52973 | [static] Add exception in MISRA2008-3_4_1 for constant variables |
CPP-52983 | [static] OPT-05 reports false positive when constexpr variable of complex type is used as template argument |
CPP-53009 | [docs] Document cpptestcli -quiet option (C/C++test Standard) |
CPP-53672 | [static] GLOBAL-UNUSEDFUNC (MISRA2008-0_1_10) reports false positive on the operator() in generic lambdas |
CPP-53673 | [static] OPT-01 (MISRA2008-3_4_1_a) reports false positive when local variable is declared inside condition of if statement |
CPP-53711 | [static] EXCEPT-12 (MISRA2008-15_1_2) reports false negative when NULL from std library is used as argument of throw |
CPP-53713 | [rulewizard] Extend 'IsInline' property to check that a variable has been declared as inline |
CPP-53717 | [static] MISRA-071_b (MISRAC2012-RULE_17_3-a) reports false positive when function call and prototype are in the same macro definition |
CPP-53757 | [compiler] Support for Tasking SmartCode 10.1 for TriCore |
CPP-53760 | [engine] error: name followed by "::" must be a class or namespace name |
CPP-53765 | [static] MISRA2004-13_7_s (AUTOSAR-M0_1_2-e) reports false positive when enumerations with negative values are used in condition |
CPP-53766 | [static] OPT-30 (AUTOSAR-A0_1_3-a): false positive on friend definition in template class |
CPP-53767 | [static] CODSTA-CPP-43 (AUTOSAR-A8_4_9-a): false positive on parameters of friend functions in template classes |
CPP-53777 | [compiler] Support for Hexagon 8.7 (Linux, Extended, Full) |
CPP-53818 | [engine] errno not set properly when tracing some exec functions |
CPP-54754 | [engine] Stubs for calls to (non-specialized) template function from other template function |
CPP-54756 | [ide] C/C++test Standard: Ability to import analysis results into CMake project in Visual Studio IDE |
CPP-54761 | [engine] Improve compiler config for clang 8 and older - invalid redeclaration of type name "std::align_val_t" (overaligned_allocation_enabled=false) |
CPP-54765 | [static] GLOBAL-UNUSEDTYPE / INTERNAL-GLOBAL-UNUSEDTYPE_2: TypeError: argument of type 'NoneType' is not iterable |
CPP-54766 | [engine] error: static assertion failed - incorrect behaviour of std::is_trivially_copyable_v |
CPP-54774 | [engine] Program received signal 11 at : Stack trace: 0# 0x00007F07709136B0 in /lib64/libc.so.6 |
CPP-54776 | [engine] No code coverage for friends of template class |
CPP-54779 | [engine] CWC: EDG failure error 83 |
CPP-54784 | [static] MISRA-084: false positive violation when a macro is used in the same line as 'return' |
CPP-54806 | [static] PREPROC-19: an error has occurred while running the rule - SyntaxError: invalid token |
CPP-54838 | [engine] Internal error: assertion failed at: "il_to_str.c", line 3749 |
CPP-54839 | [static] GLOBAL-ONEUSEVAR (MISRA2008-0_1_4) reports false positive for variables captured in lambdas |
CPP-54884 | [vscode] Map Parasoft static analysis violation severity to VSCode message severity |
CPP-54933 | [engine] C/C++test instrumentation fails to compile for array braced initializers with designators |
CPP-54946 | [engine] Parse error: parameter of abstract class type is not allowed |
CPP-54947 | [static] Change mapping for the AUTOSAR-M0_1_3 (remove AUTOSAR-M0_1_3-b) |
CPP-54949 | [cli] "cpptest.fail.setup.problems" should allow for selective fail of cpptestcli runs based on setup problem level |
CPP-54957 | [ci] Integrate code coverage reporting for GitLab |
CPP-54961 | [engine] Fatal error C++test: lambda capture of structure binding (32716) |
CPP-55008 | [engine] Incorrect instrumentation generates "error: invalid use of this at top level" |
CPP-55011 | [static] PB-20 (CERT_CPP-OOP51-a) does not check correctly the slicing problem |
CPP-55016 | [static] CERT_C-ERR33-b should be removed from the mapping to CERT ERR33 |
CPP-55022 | [static] CODSTA-CPP-85 produces violation for two unrelated template clasess. |
CPP-55055 | [ide] Flag /std:c++20 is filtered out in VS plugin |
CPP-55083 | [static] FORMAT-47_b (AUTOSAR-A7_1_3-a) reports false positive when 'const' qualifier is placed on the right-hand side of the 'time_t' type |
CPP-55124 | [static] CODSTA-CPP-58 (AUTOSAR-A0_1_2-a) reports false positive on calls of functions inside 'new' operand |
CPP-55125 | [static] CODSTA-224 (AUTOSAR-A5_16_1-a) reports false positives on conditional operators used by itself in template functions |
CPP-55128 | [static] CODSTA-MCPP-14 (AUTOSAR-A13_3_1-a) reports false positive on forwarding constructors defined with enable_if |
CPP-55129 | [static] CODSTA-CPP-78 (AUTOSAR-M9_3_3-a) reports false positive when member function uses members of anonymous union |
CPP-55132 | [engine] CTOR Stubs behave like Auto-Stubs |
CPP-55134 | [engine] Coverage build "TYPED_TEST" failed in combination with "ASSERT_NO_THROW"/"EXPECT_NO_THROW" |
CPP-55217 | [engine] error: EventTypeT was not declared in this scope |
CPP-55233 | [compiler] Hexagon Clang 8.6 does not expand response files |
CPP-55272 | [engine] parse error: no suitable user-defined conversion |
CPP-55274 | [engine] Lambda nested in template function should be reported once (with generic template as its parent) in the coverage reports |
CPP-55276 | [static] AUTOSAR-A13_2_3-a and std::enable_if |
CPP-55508 | [engine] error: expected { before : token instrumentation failure |
CPP-55576 | [engine] fix(tcov): fix position of added 'else' clause in template-coverage |
CPP-55610 | [ide] Data sources created in incorrect folder when virtual folders are using in Eclipse project |
CPP-55640 | [static] Improve mapping for HICPP-6_1_3 requirement |
CPP-55641 | [static] CODSTA-CPP-84 (HICPP-3_1_1-d) reports false positive when scoped enumerators are used |
CPP-55740 | [static] HICPP-8_3_4-a reports false positive on lvalue references |
CPP-55745 | [static] Improve mapping for HIC++ 8.1.1 requirement |
CPP-55751 | [ide] Improve importer for Renesas HEW-4 to better handle compiler options |
CPP-55753 | [static] TEMPL-10 (HICPP-14_2_1-a) reports false positive on definitions of template specializations |
CPP-55762 | [ide] Test cases for functions with "std::vector<>" as an argument cannot be created from the test case editor |
FA-9413 | Simulation does not take into account paths from new operation to catch (std::bad_alloc) |
FA-9457 | BD-PB-VOVR false positive when variable is left uninitialized |
FA-9471 | BD-RES-STACKLIM incorrectly calculates the size of the function parameter declared as an array type |
FA-9479 | BD-PB-OVERFNZT false positive on array initialized from string literal |
FA-9522 | BD-PB-CC false positive on array element value overwritten by memcpy function |
FA-9555 | BD-PB-VOVR false positive reporting variables used in the context of constexpr / static_assert |
FA-9599 | Improve BD-PB-CC rule so it cannot throw exceptions described when post-processing violations |
FA-9605 | BD-CO-ITMOD false positives for erase function |
FA-9607 | False positive with BD-PB-ARRAY with multidimensional array passed by reference |
FA-9614 | BD-PB-ARRAY bogus violation on parameter passed by reference |
FA-9618 | BD-PB-ZERO false positive for (a - b) denominator with appropriate check for a and b being unequal |
FA-9624 | BD-PB-SUBSEQMOVE false positive when address of the moved-from object is used as an argument to placement-new |
FA-9625 | BD-PB-NOTINIT false positive for unknown size array initialized with brace-enclosed list |
FA-9642 | Inaccurate fact deduction based on the complex arithmetic made on variables (e.g. 2 * x - x - x) |
FA-9665 | BD-PB-CC false positive |
Updates to Rules
New Rules
Rule ID | Header |
---|---|
AUTOSAR-A18_9_2-b | The 'std::move' function should be used to forward rvalue references |
AUTOSAR-A27_0_4-e | Do not use the 'c_str()' and 'data()' functions for string objects |
AUTOSAR-M3_2_4-b | An identifier with external linkage shall have external definition |
BD-PB-LIFETIME | Do not use an object after its lifetime has ended |
BD-PB-NAUNF | Do not read the value of a non-active union field |
CERT_C-MSC14-b | Evaluation of constant unsigned integer expressions in preprocessor directives should not lead to wraparound |
CERT_C-MSC15-b | Evaluation of constant unsigned integer expressions in preprocessor directives should not lead to wraparound |
CODSTA-124_c | Casts shall not be performed between a pointer to a function and any other type |
CODSTA-185_c | The address of the 'localeconv', 'getenv', 'setlocale' or, 'strerror' function should not be taken |
CODSTA-223_c | The names of the standard signed integer types and standard unsigned integer types should not be used |
CODSTA-233 | Types of bit-fields should have defined sizes |
CODSTA-234 | The 'asm' declaration should not be used |
CODSTA-235 | The library functions 'rewind', 'setbuf' and 'ctime' should not be used |
CODSTA-236 | The built-in unary + operator should not be used |
CODSTA-237 | The character handling functions from <cctype> and <cwctype> shall not be used |
CODSTA-238 | The C++ Standard Library functions 'memcpy', 'memmove' and 'memcmp' from <cstring> should not be used |
CODSTA-239 | The literal value zero shall be the only value assigned to errno |
CODSTA-240 | A cast should not convert a pointer type to 'intptr_t' and 'uintptr_t' types |
CODSTA-241 | All 'if...else-if' constructs shall be terminated with an 'else' clause |
CODSTA-242 | The string handling functions from <cstring>, <cstdlib>, <cwchar> and <cinttypes> shall not be used |
CODSTA-243 | The 'switch' statement should not contain labels other than 'case' and 'default' |
CODSTA-304 | A bit-field shall have an appropriate type |
CODSTA-305 | All enumeration values should be representable within the width of the bit-field |
CODSTA-306 | The volatile qualifier shall be used appropriately |
CODSTA-307 | Operands of bitwise and complement operators shall have an unsigned type |
CODSTA-308 | Operands of shift operators shall have an unsigned type |
CODSTA-309 | A conversion from function type to pointer-to-function type shall only occur in appropriate contexts |
CODSTA-310 | Integral promotion and the usual arithmetic conversions shall not change the signedness or the type category of an operand |
CODSTA-311 | The address of an object with automatic storage duration shall not be assigned to an object with a greater lifetime |
CODSTA-312 | Assignment between numeric types shall be appropriate |
CODSTA-313 | The numeric value of an unscoped enumeration with no fixed underlying type shall not be used |
CODSTA-314 | The 'assert' macro shall not be used with a constant expression |
CODSTA-315 | Legacy 'for' statements should be simple |
CODSTA-61_b | The first or the last label of a switch statement should be the 'default' label unless all enumeration values are tested |
CODSTA-63_b | Use bitwise operators only on unsigned operands |
CODSTA-64_b | Every switch branch should be unconditionally terminated |
CODSTA-65_b | An object with enumeration type shall not be converted to an object with pointer type |
CODSTA-67_b | The same type aliases shall be used in all declarations of the same entity |
CODSTA-CPP-110 | Member variable names in derived classes should not be the same as member variable names in base classes |
CODSTA-CPP-111 | The 'NULL' identifier should not be used |
CODSTA-CPP-112 | The result of std::remove, std::remove_if, std::unique and empty shall be used |
CODSTA-CPP-113 | The 'std::locale::global' function should not be used |
CODSTA-CPP-201 | Non-static data members should be either all private or all public |
CODSTA-CPP-202 | An enumeration shall be defined with an explicit underlying type |
CODSTA-CPP-203 | An explicit or implicit enumerator value shall not be the result of a narrowing conversion |
CODSTA-CPP-204 | The operand to typeid shall not be an expression of polymorphic class type |
CODSTA-CPP-205 | User-provided copy and move member functions of a class should have appropriate signatures |
CODSTA-CPP-206 | Member functions returning references to their object should be ref-qualified appropriately |
CODSTA-CPP-207 | An argument passed via ellipsis shall have an appropriate type |
CODSTA-CPP-208 | Exception-unfriendly functions shall be noexcept |
CODSTA-CPP-209 | Functions used as initializers of non-constexpr non-local variables shall be noexcept |
CODSTA-CPP-210 | Parameters in an overriding virtual function shall not specify different default arguments |
CODSTA-CPP-211 | There shall be no conversion from type bool |
CODSTA-CPP-212 | There shall be no conversion to type bool |
CODSTA-CPP-95_b | Do not declare entities in the standard library namespaces: posix, std and stdN |
CODSTA-MCPP-101 | A for-range-initializer shall contain at most one function call |
CODSTA-MCPP-103 | Variables should be captured explicitly in a non-transient lambda |
CODSTA-MCPP-104 | A non-transient lambda shall not implicitly capture this |
CODSTA-MCPP-105 | Special member functions shall be provided appropriately |
CODSTA-MCPP-13_c | The 'std::forward' function should only be used to forward forwarding references |
CODSTA-MCPP-13_d | The 'std::move' function should be used to forward rvalue references |
CODSTA-MCPP-47_b | A class shall only define an initializer-list constructor when it is the only constructor |
CODSTA-MCPP-57 | The raw pointer constructors of 'std::shared_ptr' and 'std::unique_ptr' should not be used |
CODSTA-MCPP-58 | Do not include headers deprecated in the C++17 standard |
CODSTA-MCPP-59 | The 'uncaught_exception' function deprecated in the C++17 standard should not be used |
CODSTA-MCPP-60 | The condition of a 'switch' statement should only be preceded by an optional simple-declaration |
CODSTA-MCPP-61 | Define =delete functions with parameters of type rvalue reference to const |
COMMENT-14_c | Every function declaration should have a proper documentation |
CWE-190-i | Evaluation of constant unsigned integer expressions in preprocessor directives should not lead to wraparound |
EXCEPT-27 | A 'try' statement of a 'try-block' should contain a potentially-throwing statement |
FORMAT-50 | Use parentheses to indicate the precedence of operators in expressions |
GLOBAL-NOEXTERNDEF | An identifier with external linkage shall have external definition |
GLOBAL-PREDICATENOSE | Predicates shall not have persistent side effects |
HICPP-17_3_2-b | The 'std::forward' function should only be used to forward forwarding references |
HICPP-17_3_2-c | The 'std::move' function should be used to forward rvalue references |
INIT-101 | All non-class variables with automatic storage duration should be explicitly initialized |
INIT-19 | All direct, non-static data members of a non-aggregate class should be initialized at the top of a constructor body |
INIT-20 | All direct, non-static data members of an aggregate class should be initialized as soon as the object is created |
JSF-203_b | Evaluation of expressions shall not lead to overflow/underflow |
MISRA-051_b | Evaluation of constant unsigned integer expressions in preprocessor directives should not lead to wraparound |
MISRA-102 | No more than 2 levels of pointer indirection should be used |
MISRA2008-3_2_4_b | An identifier with external linkage shall have exactly one external definition |
MISRA2012-RULE-8_6_b | An identifier with external linkage shall have exactly one external definition |
MISRAC2012-RULE_8_6-b | An identifier with external linkage shall have external definition |
MISRACPP2023-0_0_1-a | There shall be no unreachable code in "else" block |
MISRACPP2023-0_0_1-b | There shall be no unreachable code after 'return', 'break', 'continue', 'goto', 'throw' statements, and after calls to functions with the 'noreturn' attribute |
MISRACPP2023-0_0_1-c | There shall be no unreachable code in "if/else/while/for" block |
MISRACPP2023-0_0_1-d | There shall be no unreachable code in switch statement |
MISRACPP2023-0_0_1-e | There shall be no unreachable code in 'for' loop |
MISRACPP2023-0_0_1-f | There shall be no unreachable code after 'if' or 'switch' statement |
MISRACPP2023-0_0_1-g | There shall be no unreachable code after "if" or "switch" statement inside while/for/do...while loop |
MISRACPP2023-0_0_1-h | Where multiple handlers are provided in a single try-catch statement or function-try-block for a derived class and some or all of its bases, the handlers shall be ordered most-derived to base class |
MISRACPP2023-0_0_1-i | Where multiple handlers are provided in a single 'try-catch' statement or 'function-try-block', any ellipsis (catch-all) handler shall occur last |
MISRACPP2023-0_0_1-j | A 'try' statement of a 'try-block' should contain a potentially-throwing statement |
MISRACPP2023-0_0_2-a | Avoid conditions that always evaluate to the same value |
MISRACPP2023-0_1_1-a | Avoid unused values |
MISRACPP2023-0_1_2-a | The value returned by a function having a non-void return type that is not an overloaded operator shall always be used |
MISRACPP2023-0_2_1-a | Avoid unused local variables |
MISRACPP2023-0_2_1-b | A project should not contain unused variables with internal linkage |
MISRACPP2023-0_2_2-a | Eliminate unused parameters |
MISRACPP2023-0_2_2-b | There shall be no unused named parameters in virtual functions |
MISRACPP2023-0_2_3-a | Types declared in an unnamed namespace scope should be used at least once |
MISRACPP2023-0_2_3-b | Types declared in a block scope should be used at least once |
MISRACPP2023-0_2_4-a | Avoid unreachable methods |
MISRACPP2023-0_3_1-a | Do not use object representations to compare floating-point values |
MISRACPP2023-0_3_1-b | Floating-point expressions shall not be explicitly (syntactically) tested for equality (==) or inequality (!=) |
MISRACPP2023-0_3_1-c | Do not use floating point variables as loop counters |
MISRACPP2023-0_3_1-d | Do not use floating-point expressions which may result in NaN and infinity values |
MISRACPP2023-0_3_2-a | Do not pass incorrect values to library functions |
MISRACPP2023-10_0_1-a | Each variable should be declared in a separate declaration statement |
MISRACPP2023-10_1_1-a | A pointer parameter in a function prototype should be declared as pointer to const if the pointer is not used to modify the addressed object |
MISRACPP2023-10_1_1-b | Declare a type of parameter as typedef to pointer to const if the pointer is not used to modify the addressed object |
MISRACPP2023-10_1_1-c | Declare reference parameters as const references whenever possible |
MISRACPP2023-10_1_2-a | The volatile qualifier shall be used appropriately |
MISRACPP2023-10_2_1-a | An enumeration shall be defined with an explicit underlying type |
MISRACPP2023-10_2_1-b | An explicit or implicit enumerator value shall not be the result of a narrowing conversion |
MISRACPP2023-10_2_2-a | Prefer Scoped Enums to Unscoped Enums |
MISRACPP2023-10_2_3-a | The numeric value of an unscoped enumeration with no fixed underlying type shall not be used |
MISRACPP2023-10_3_1-a | There shall be no unnamed namespaces in header files |
MISRACPP2023-10_4_1-a | The 'asm' declaration should not be used |
MISRACPP2023-11_3_1-a | C-style arrays shall not be used |
MISRACPP2023-11_3_2-a | The declaration of objects should contain no more than 2 levels of pointer indirection |
MISRACPP2023-11_6_1-a | All non-class variables with automatic storage duration should be explicitly initialized |
MISRACPP2023-11_6_2-a | Avoid use before initialization |
MISRACPP2023-11_6_3-a | Within an enumerator list, the value of an implicitly-specified enumeration constant shall be unique |
MISRACPP2023-12_2_1-a | Do not declare member variables as bit-fields |
MISRACPP2023-12_2_2-a | A bit-field shall have an appropriate type |
MISRACPP2023-12_2_2-b | All enumeration values should be representable within the width of the bit-field |
MISRACPP2023-12_2_3-a | Named bit-fields with signed integer type shall have a length of more than one bit |
MISRACPP2023-12_3_1-a | The union keyword should not be used |
MISRACPP2023-13_1_1-a | Classes should not be derived from virtual bases |
MISRACPP2023-13_1_2-a | A base class shall not be both virtual and non-virtual in the same hierarchy |
MISRACPP2023-13_3_1-a | Each overriding virtual function shall be declared with the override or final specifier |
MISRACPP2023-13_3_1-b | Only one of virtual, override or final should be specified in a member function declaration |
MISRACPP2023-13_3_2-a | Parameters in an overriding virtual function shall not specify different default arguments |
MISRACPP2023-13_3_3-a | The identifiers used in the declaration and definition of a function shall be identical |
MISRACPP2023-13_3_3-b | The parameters in all overrides of a function should either be unnamed or have identical names |
MISRACPP2023-13_3_4-a | A pointer to member virtual function shall only be tested for equality with null-pointer-constant |
MISRACPP2023-14_1_1-a | Non-static data members should be either all private or all public |
MISRACPP2023-15_0_1-a | Special member functions shall be provided appropriately |
MISRACPP2023-15_0_1-b | Destructor shall have a non-empty body |
MISRACPP2023-15_0_2-a | User-provided copy and move member functions of a class should have appropriate signatures |
MISRACPP2023-15_1_1-a | Do not use dynamic type of an object under construction |
MISRACPP2023-15_1_1-b | Do not use dynamic type of an object under destruction |
MISRACPP2023-15_1_2-a | All constructors of a class should explicitly call a constructor for all of its immediate base classes and all virtual base classes |
MISRACPP2023-15_1_3-a | Constructors allowing for conversion should be made explicit |
MISRACPP2023-15_1_3-b | User-conversion cast operators should be made explicit |
MISRACPP2023-15_1_4-a | All direct, non-static data members of a non-aggregate class should be initialized at the top of a constructor body |
MISRACPP2023-15_1_4-b | All direct, non-static data members of an aggregate class should be initialized as soon as the object is created |
MISRACPP2023-15_1_5-a | A class shall only define an initializer-list constructor when it is the only constructor |
MISRACPP2023-15_8_1-a | Check for assignment to self in operator= |
MISRACPP2023-16_5_1-a | Avoid overloading logical operators AND, OR (, ||) |
MISRACPP2023-16_5_2-a | The unary & operator shall not be overloaded |
MISRACPP2023-16_6_1-a | If you'd like to support mixed-mode operations make operators a non-member functions |
MISRACPP2023-17_8_1-a | Function templates shall not be explicitly specialized |
MISRACPP2023-18_1_1-a | An exception object should not have pointer type |
MISRACPP2023-18_1_2-a | An empty throw (throw;) shall only be used in the compound-statement of a catch handler |
MISRACPP2023-18_2_2-a | The string handling functions from<cstring>, <cstdlib>, <cwchar> and <cinttypes> shall not be used |
MISRACPP2023-18_3_1-a | There should be at least one exception handler to catch all otherwise unhandled exceptions |
MISRACPP2023-18_3_2-a | A class type exception shall always be caught by reference |
MISRACPP2023-18_3_3-a | Handlers of a function-try-block implementation of a class constructor or destructor shall not reference nonstatic members from this class or its bases |
MISRACPP2023-18_4_1-a | Exception-unfriendly functions shall be noexcept |
MISRACPP2023-18_4_1-b | Functions used as initializers of non-constexpr non-local variables shall be noexcept |
MISRACPP2023-18_5_1-a | Avoid throwing exceptions from functions that are declared not to throw |
MISRACPP2023-18_5_2-a | The 'abort()' function from the 'stdlib.h' or 'cstdlib' library shall not be used |
MISRACPP2023-18_5_2-b | The 'exit()' function from the 'stdlib.h' or 'cstdlib' library shall not be used |
MISRACPP2023-18_5_2-c | The 'quick_exit()' and '_Exit()' functions from the 'stdlib.h' or 'cstdlib' library shall not be used |
MISRACPP2023-19_0_1-a | Preprocessing directives shall be syntactically meaningful even when excluded by the preprocessor |
MISRACPP2023-19_0_2-a | Function-like macros shall not be defined |
MISRACPP2023-19_0_3-a | #include statements in a file should only be preceded by other preprocessor directives or comments |
MISRACPP2023-19_0_4-a | #undef should only be used for macros defined previously in the same file |
MISRACPP2023-19_1_1-a | The defined preprocessor operator shall only be used in one of the two standard forms |
MISRACPP2023-19_1_2-a | All #else, #elif and #endif preprocessor directives shall reside in the same file as the #if or #ifdef directive to which they are related |
MISRACPP2023-19_1_3-a | Do not use in preprocessor directives #if and #elif macros not defined in translation unit |
MISRACPP2023-19_2_1-a | Use multiple include guards |
MISRACPP2023-19_2_2-a | The #include directive shall be followed by either a <filename> or "filename" sequence |
MISRACPP2023-19_2_3-a | Non-standard characters should not occur in header file names in #include directives |
MISRACPP2023-19_3_1-a | The # and ## preprocessor operators should not be used |
MISRACPP2023-19_3_2-a | A macro parameter immediately following a # operator shall not immediately be followed by a ## operator |
MISRACPP2023-19_3_3-a | A 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 operators |
MISRACPP2023-19_3_4-a | In the definition of a function-like macro each instance of a parameter shall be enclosed in parentheses unless it is used as the operand of # or ## |
MISRACPP2023-19_3_5-a | Arguments to a function-like macro shall not contain tokens that look like preprocessing directives |
MISRACPP2023-19_6_1-a | The #pragma directive shall not be used |
MISRACPP2023-19_6_1-b | The '_Pragma' operator should not be used |
MISRACPP2023-21_10_1-a | The identifiers va_list, va_arg, va_start, va_end, va_copy should not be used |
MISRACPP2023-21_10_2-a | The facilities provided by <setjmp.h> should not be used |
MISRACPP2023-21_10_2-b | The standard header files <setjmp.h> or <csetjmp> shall not be used |
MISRACPP2023-21_10_3-a | The signal handling facilities of <signal.h> shall not be used |
MISRACPP2023-21_2_1-a | The library functions atof, atoi and atol from library stdlib.h shall not be used |
MISRACPP2023-21_2_3-a | The 'system()' function from the 'stdlib.h' or 'cstdlib' library shall not be used |
MISRACPP2023-21_2_4-a | The macro offsetof, in library stddef.h, shall not be used |
MISRACPP2023-21_6_1-a | Dynamic heap memory allocation shall not be used |
MISRACPP2023-21_6_2-a | Dynamic heap memory allocation shall not be used |
MISRACPP2023-21_6_2-b | Any member function named 'allocate' or 'deallocate' enclosed by namespace 'std' should not be used |
MISRACPP2023-21_6_2-c | The 'std::unique_ptr::release' function should not be used |
MISRACPP2023-21_6_3-a | Destructor should not be called manually |
MISRACPP2023-21_6_3-b | Do not declare the 'new' and 'delete' operators |
MISRACPP2023-21_6_3-c | The memory management functions from the <new> and <memory> headers should not be used |
MISRACPP2023-21_6_3-d | Advanced memory management operators 'new' and 'delete' should not be used |
MISRACPP2023-21_6_4-a | Define both sized and unsized versions of operator delete |
MISRACPP2023-21_6_5-a | Do not delete objects with incomplete class at the point of deletion |
MISRACPP2023-22_3_1-a | The 'assert' macro shall not be used with a constant expression |
MISRACPP2023-22_4_1-a | The literal value zero shall be the only value assigned to errno |
MISRACPP2023-23_11_1-a | The raw pointer constructors of 'std::shared_ptr' and 'std::unique_ptr' should not be used |
MISRACPP2023-24_5_1-a | The character handling functions from <cctype> and <cwctype> shall not be used |
MISRACPP2023-24_5_2-a | The C++ Standard Library functions 'memcpy', 'memmove' and 'memcmp' from <cstring> should not be used |
MISRACPP2023-25_5_1-a | The 'setlocale' function should not be used |
MISRACPP2023-25_5_1-b | The 'std::locale::global' function should not be used |
MISRACPP2023-25_5_2-a | 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 type |
MISRACPP2023-25_5_2-b | Strings pointed by members of the structure 'lconv' should not be modified |
MISRACPP2023-25_5_2-c | The address of the 'localeconv', 'getenv', 'setlocale' or, 'strerror' function should not be taken |
MISRACPP2023-25_5_3-a | Pointers returned by certain Standard Library functions should not be used following a subsequent call to the same or related function |
MISRACPP2023-26_3_1-a | Avoid using vectorboo |
MISRACPP2023-28_3_1-a | Predicates shall not have persistent side effects |
MISRACPP2023-28_6_1-a | Do not use std::move on objects declared with the const or consttype |
MISRACPP2023-28_6_2-a | The 'std::forward' function should be used to forward forwarding references |
MISRACPP2023-28_6_2-b | The 'std::forward' function should only be used to forward forwarding references |
MISRACPP2023-28_6_3-a | Do not subsequently use the argument to std::forward |
MISRACPP2023-28_6_3-b | Do not rely on the value of a moved-from object |
MISRACPP2023-28_6_4-a | The result of std::remove, std::remove_if, std::unique and empty shall be used |
MISRACPP2023-30_0_1-a | The input/output library stdio.h shall not be used |
MISRACPP2023-30_0_1-b | Prefer iostream.h to stdio.h |
MISRACPP2023-30_0_2-a | Do not alternately input and output from a stream without an intervening flush or positioning call |
MISRACPP2023-4_1_2-a | Do not include headers deprecated in the C++17 standard |
MISRACPP2023-4_1_2-b | The 'uncaught_exception' function deprecated in the C++17 standard should not be used |
MISRACPP2023-4_1_2-c | Do not use throw exception specifications |
MISRACPP2023-4_1_2-d | A constexpr static data member should not be declared outside the class definition |
MISRACPP2023-4_1_3-a | Avoid incorrect shift operations |
MISRACPP2023-4_1_3-b | Avoid signed integer overflows |
MISRACPP2023-4_1_3-c | Avoid null pointer dereferencing |
MISRACPP2023-4_1_3-d | Avoid division by zero |
MISRACPP2023-4_6_1-a | The value of an expression shall be the same under any order of evaluation that the standard permits |
MISRACPP2023-4_6_1-b | Don't write code that depends on the order of evaluation of function arguments |
MISRACPP2023-4_6_1-c | Don't write code that depends on the order of evaluation of function designator and function arguments |
MISRACPP2023-4_6_1-d | Don't write code that depends on the order of evaluation of expression that involves a function call |
MISRACPP2023-4_6_1-e | Between sequence points an object shall have its stored value modified at most once by the evaluation of an expression |
MISRACPP2023-4_6_1-f | Do not use more than one volatile between two adjacent sequence points |
MISRACPP2023-4_6_1-g | Don't write code that depends on the order of evaluation of function calls |
MISRACPP2023-5_0_1-a | Trigraphs shall not be used |
MISRACPP2023-5_10_1-a | Do not declare entities in the standard library namespaces: posix, std and stdN |
MISRACPP2023-5_10_1-b | Do not use identifiers which begin with one or two underscores ('_' or '__') |
MISRACPP2023-5_10_1-c | An identifier shall not contain a double underscore '__' |
MISRACPP2023-5_10_1-d | User defined suffixes of the user defined literal operators shall start with underscore followed by one or more letters |
MISRACPP2023-5_10_1-e | A user-defined literal suffix should be directly preceded by a literal operator |
MISRACPP2023-5_10_1-f | A macro identifier should have an appropriate form |
MISRACPP2023-5_10_1-g | Do not declare identifiers with names reserved in the standard library |
MISRACPP2023-5_13_1-a | Only those escape sequences that are defined in ISO/IEC 14882:2014 shall be used |
MISRACPP2023-5_13_2-a | Octal and hexadecimal escape sequences shall be terminated |
MISRACPP2023-5_13_3-a | Octal constants (other than zero) shall not be used |
MISRACPP2023-5_13_4-a | A 'U' suffix shall be applied to all constants of unsigned type |
MISRACPP2023-5_13_5-a | Use capital 'L' instead of lowercase 'l' to indicate long |
MISRACPP2023-5_13_6-a | An integer-literal of type long long shall not use a single 'L' or 'l' in any suffix |
MISRACPP2023-5_13_7-a | String literals with different encoding prefixes shall not be concatenated |
MISRACPP2023-5_13_7-b | String literals with and without encoding prefixes should not be concatenated |
MISRACPP2023-5_7_1-a | The character sequence /* shall not be used within a C-style comment |
MISRACPP2023-5_7_2-a | Sections of code should not be "commented out" |
MISRACPP2023-5_7_3-a | Line-splicing shall not be used in // comments |
MISRACPP2023-6_0_1-a | Always declare functions at file scope |
MISRACPP2023-6_0_1-b | Parameter names in function declarations should not be enclosed in parentheses |
MISRACPP2023-6_0_1-c | Local variable names in variable declarations should not be enclosed in parentheses |
MISRACPP2023-6_0_2-a | When an array is declared with external linkage, its size shall be stated explicitly or defined implicitly by initialisation |
MISRACPP2023-6_0_3-a | The global namespace shall only contain main() and namespace declarations |
MISRACPP2023-6_0_4-a | The identifier main shall not be used for a function other than the global function main |
MISRACPP2023-6_2_1-a | The One Definition Rule shall not be violated |
MISRACPP2023-6_2_2-a | All declarations of an object or function shall have compatible types |
MISRACPP2023-6_2_2-b | If a function is declared with an exception-specification, then all declarations of the same function (in other translation units) shall be declared with the same set of type-ids |
MISRACPP2023-6_2_3-a | An identifier with external linkage shall have no more then one external definition |
MISRACPP2023-6_2_3-b | A type that is used in multiple translation units shall be defined in one and only one file |
MISRACPP2023-6_2_3-c | An inline function that is used in multiple translation units shall be defined in one and only one file |
MISRACPP2023-6_2_3-d | Template specialization shall be declared in the same file as the primary template or a user-defined type, for which the specialization is declared |
MISRACPP2023-6_2_4-a | Don't define entities with linkage in a header file |
MISRACPP2023-6_4_1-a | Identifier declared in a local or function prototype scope shall not hide an identifier declared in a global or namespace scope |
MISRACPP2023-6_4_1-b | Identifiers declared in an inner local scope should not hide identifiers declared in an outer local scope |
MISRACPP2023-6_4_1-c | Identifiers declared in a local scope should not hide identifiers declared in a class scope |
MISRACPP2023-6_4_1-d | Identifiers declared in a class scope should not hide identifiers declared in a global or namespace scope |
MISRACPP2023-6_4_1-e | Identifiers declared in an inner class scope should not hide identifiers declared in outer class scope |
MISRACPP2023-6_4_1-f | Member variable names in derived classes should not be the same as member variable names in base classes |
MISRACPP2023-6_4_2-a | Never redefine an inherited nonvirtual function |
MISRACPP2023-6_4_2-b | Member functions declared in derived class should not hide functions declared in base classes |
MISRACPP2023-6_4_3-a | In a class template with a dependent base, any name that may be found in that dependent base shall be referred to using a qualified-id or this |
MISRACPP2023-6_5_1-a | Objects or functions with external linkage shall be declared in a header file |
MISRACPP2023-6_5_2-a | Do not use static keyword except inside functions and classes |
MISRACPP2023-6_5_2-b | Identifiers shall not simultaneously have both internal and external linkage in the same translation unit |
MISRACPP2023-6_7_1-a | Local variables shall not have static storage duration |
MISRACPP2023-6_7_2-a | Avoid unencapsulated global variables (including variables declared in namespaces and public static members) |
MISRACPP2023-6_8_1-a | Do not point to a wrapped object that has been freed |
MISRACPP2023-6_8_1-b | Do not read the value of a non-active union field |
MISRACPP2023-6_8_1-c | Do not use an object after its lifetime has ended |
MISRACPP2023-6_8_2-a | The address of an object with automatic storage shall not be returned from a function |
MISRACPP2023-6_8_2-b | Never return lambdas that capture local objects by reference |
MISRACPP2023-6_8_3-a | The address of an object with automatic storage duration shall not be assigned to an object with a greater lifetime |
MISRACPP2023-6_8_4-a | Member functions returning references to their object should be ref-qualified appropriately |
MISRACPP2023-6_9_1-a | The same type aliases shall be used in all declarations of the same entity |
MISRACPP2023-6_9_2-a | The names of the standard signed integer types and standard unsigned integer types should not be used |
MISRACPP2023-7_0_1-a | There shall be no conversion from type bool |
MISRACPP2023-7_0_2-a | There shall be no conversion to type bool |
MISRACPP2023-7_0_3-a | The plain char type shall be used only for the storage and use of character values |
MISRACPP2023-7_0_3-b | signed and unsigned char type shall be used only for the storage and use of numeric values |
MISRACPP2023-7_0_4-a | Operands of bitwise and complement operators shall have an unsigned type |
MISRACPP2023-7_0_4-b | Operands of shift operators shall have an unsigned type |
MISRACPP2023-7_0_5-a | Integral promotion and the usual arithmetic conversions shall not change the signedness or the type category of an operand |
MISRACPP2023-7_0_6-a | Assignment between numeric types shall be appropriate |
MISRACPP2023-7_11_1-a | Prefer 'nullptr' over 'NULL' or '0'(zero) |
MISRACPP2023-7_11_1-b | The 'NULL' identifier should not be used |
MISRACPP2023-7_11_2-a | Do not pass an expression with array type to a function with a pointer or array type parameter |
MISRACPP2023-7_11_3-a | A conversion from function type to pointer-to-function type shall only occur in appropriate contexts |
MISRACPP2023-8_0_1-a | The operand of the 'sizeof' operator should be enclosed in parentheses |
MISRACPP2023-8_0_1-b | Use parentheses to indicate the precedence of operators in expressions |
MISRACPP2023-8_14_1-a | The right-hand operand of a unary && or || operator shall not contain side effects |
MISRACPP2023-8_18_1-a | An object shall not be assigned or copied to an overlapping object |
MISRACPP2023-8_18_1-b | An object shall not be assigned to an overlapping object |
MISRACPP2023-8_18_1-c | An object shall not be assigned to an overlapping object |
MISRACPP2023-8_18_2-a | The result of a built-in assignment operator should not be used |
MISRACPP2023-8_19_1-a | The comma operator shall not be used |
MISRACPP2023-8_1_1-a | A non-transient lambda shall not implicitly capture this |
MISRACPP2023-8_1_2-a | Variables should be captured explicitly in a non-transient lambda |
MISRACPP2023-8_20_1-a | Evaluation of constant unsigned integer expressions should not lead to wrap-around |
MISRACPP2023-8_20_1-b | Evaluation of constant unsigned integer expressions in preprocessor directives should not lead to wraparound |
MISRACPP2023-8_2_1-a | A pointer to a virtual base class shall only be cast to a pointer to a derived class by means of dynamic_cast |
MISRACPP2023-8_2_10-a | Do not use recursion |
MISRACPP2023-8_2_11-a | An argument passed via ellipsis shall have an appropriate type |
MISRACPP2023-8_2_2-a | C-style casts (other than void casts) and functional notation casts (other than explicit constructor calls) shall not be used |
MISRACPP2023-8_2_3-a | A cast shall not remove any 'const' or 'volatile' qualification from the type of a pointer or reference |
MISRACPP2023-8_2_4-a | Casts shall not be performed between a pointer to a function and any other type |
MISRACPP2023-8_2_5-a | Avoid using reinterpret_cast |
MISRACPP2023-8_2_6-a | An object with integer type or pointer to void type shall not be converted to an object with pointer type |
MISRACPP2023-8_2_6-b | An object with enumeration type shall not be converted to an object with pointer type |
MISRACPP2023-8_2_7-a | A cast should not convert a pointer type to an integral type |
MISRACPP2023-8_2_7-b | A cast should not convert a pointer type to 'intptr_t' and 'uintptr_t' types |
MISRACPP2023-8_2_8-a | A cast should not convert a pointer type to an integral type |
MISRACPP2023-8_2_9-a | The operand to typeid shall not be an expression of polymorphic class type |
MISRACPP2023-8_3_1-a | The unary minus operator shall not be applied to an expression whose underlying type is unsigned |
MISRACPP2023-8_3_2-a | The built-in unary + operator should not be used |
MISRACPP2023-8_7_1-a | Avoid accessing arrays out of bounds |
MISRACPP2023-8_7_1-b | A pointer operand and any pointer resulting from pointer arithmetic using that operand shall both address elements of the same array |
MISRACPP2023-8_7_1-c | Avoid overflow when reading from a buffer |
MISRACPP2023-8_7_1-d | Avoid overflow when writing to a buffer |
MISRACPP2023-8_7_1-e | Avoid overflow due to reading a not zero terminated string |
MISRACPP2023-8_7_2-a | Do not subtract two pointers that do not address elements of the same array |
MISRACPP2023-8_9_1-a | Do not compare two unrelated pointers |
MISRACPP2023-9_2_1-a | Expression statements shall not be explicit calls to constructors of temporary objects only |
MISRACPP2023-9_3_1-a | The statement forming the body of a 'switch', 'while', 'do...while' or 'for' statement shall be a compound statement |
MISRACPP2023-9_3_1-b | 'if' and 'else' should be followed by a compound statement |
MISRACPP2023-9_4_1-a | All 'if...else-if' constructs shall be terminated with an 'else' clause |
MISRACPP2023-9_4_2-a | The first or the last label of a switch statement should be the 'default' label unless all enumeration values are tested |
MISRACPP2023-9_4_2-b | Every switch branch should be unconditionally terminated |
MISRACPP2023-9_4_2-c | A switch label shall only be used when the most closely-enclosing compound statement is the body of a switch statement |
MISRACPP2023-9_4_2-d | A switch statement shall only contain switch labels and switch clauses, and no other code |
MISRACPP2023-9_4_2-e | Every switch statement shall have at least two switch-clauses |
MISRACPP2023-9_4_2-f | The 'switch' statement should not contain labels other than 'case' and 'default' |
MISRACPP2023-9_4_2-g | The condition of a 'switch' statement should only be preceded by an optional simple-declaration |
MISRACPP2023-9_5_1-a | Legacy 'for' statements should be simple |
MISRACPP2023-9_5_2-a | A for-range-initializer shall contain at most one function call |
MISRACPP2023-9_6_1-a | The goto statement shall not be used |
MISRACPP2023-9_6_2-a | Any label referenced by a goto statement shall be declared in the same block, or in a block enclosing the goto statement |
MISRACPP2023-9_6_3-a | The goto statement shall jump to a label declared later in the same function body |
MISRACPP2023-9_6_4-a | Never return from functions that should not return |
MISRACPP2023-9_6_5-a | All exit paths from a function, except main(), with non-void return type shall have an explicit return statement with an expression |
MRM-59 | Do not declare the 'new' and 'delete' operators |
MRM-60 | The memory management functions from the <new> and <memory> headers should not be used |
MRM-61 | Advanced memory management operators 'new' and 'delete' should not be used |
MRM-62_a | Any member function named 'allocate' or 'deallocate' enclosed by namespace 'std' should not be used |
MRM-62_b | The 'std::unique_ptr::release' function should not be used |
NAMING-33_b | An identifier shall not contain a double underscore '__' |
NAMING-51_b | A user-defined literal suffix should be directly preceded by a literal operator |
NAMING-55 | A macro identifier should have an appropriate form |
NAMING-56 | Do not declare identifiers with names reserved in the standard library |
NAMING-57 | The parameters in all overrides of a function should either be unnamed or have identical names |
OPT-44 | A constexpr static data member should not be declared outside the class definition |
OPT-45 | Non-const objects with internal linkage should be defined at function scope if they are only accessed from within a single function |
OPT-46 | Types declared in an unnamed namespace scope should be used at least once |
OPT-47 | Types declared in a block scope should be used at least once |
OPT-48 | Destructor shall have a non-empty body |
PB-38_c | String literals with and without encoding prefixes should not be concatenated |
PB-73_b | Evaluation of constant unsigned integer expressions in preprocessor directives should not lead to wraparound |
PORT-38 | An integer-literal of type long long shall not use a single 'L' or 'l' in any suffix |
PREPROC-23_b | The '_Pragma' operator should not be used |
PREPROC-25_b | #undef should only be used for macros defined previously in the same file |
PREPROC-28 | Function-like macros shall not be defined |
SECURITY-54 | Do not use the 'c_str()' and 'data()' functions for string objects |
TEMPL-09_b | Function templates shall not be explicitly specialized |
Updated Rules
Category ID | Rule IDs |
---|---|
AUTOSAR C++14 Coding Guidelines | AUTOSAR-A0_1_1-a, AUTOSAR-A0_1_2-a, AUTOSAR-A0_1_3-a, AUTOSAR-A0_1_4-a, AUTOSAR-A0_1_6-a, AUTOSAR-A12_8_3-a, AUTOSAR-A13_2_3-a, AUTOSAR-A13_3_1-a, AUTOSAR-A15_4_2-a, AUTOSAR-A18_0_3-b, AUTOSAR-A18_9_2-a, AUTOSAR-A23_0_2-a, AUTOSAR-A27_0_2-a, AUTOSAR-A27_0_2-b, AUTOSAR-A27_0_3-a, AUTOSAR-A2_10_1-d, AUTOSAR-A3_1_1-a, AUTOSAR-A3_3_1-b, AUTOSAR-A4_10_1-b, AUTOSAR-A5_0_3-a, AUTOSAR-A5_16_1-a, AUTOSAR-A5_1_4-a, AUTOSAR-A5_2_5-a, AUTOSAR-A5_2_5-c, AUTOSAR-A5_6_1-a, AUTOSAR-A7_1_1-a, AUTOSAR-A7_1_1-b, AUTOSAR-A7_1_3-a, AUTOSAR-A7_2_5-a, AUTOSAR-A7_4_1-a, AUTOSAR-A8_4_2-a, AUTOSAR-A8_4_3-b, AUTOSAR-A8_4_9-a, AUTOSAR-A8_5_0-a, AUTOSAR-A8_5_4-a, AUTOSAR-A9_3_1-a, AUTOSAR-A9_3_1-b, AUTOSAR-A9_6_1-a, AUTOSAR-M0_1_1-b, AUTOSAR-M0_1_10-a, AUTOSAR-M0_1_10-b, AUTOSAR-M0_1_2-ac, AUTOSAR-M0_1_2-b, AUTOSAR-M0_1_2-e, AUTOSAR-M0_1_2-f, AUTOSAR-M0_1_2-g, AUTOSAR-M0_1_3-c, AUTOSAR-M0_1_4-a, AUTOSAR-M0_3_1-a, AUTOSAR-M0_3_1-b, AUTOSAR-M0_3_1-c, AUTOSAR-M0_3_1-d, AUTOSAR-M0_3_1-e, AUTOSAR-M0_3_1-g, AUTOSAR-M15_1_2-a, AUTOSAR-M16_1_1-a, AUTOSAR-M3_4_1-a, AUTOSAR-M3_4_1-b, AUTOSAR-M5_0_16-a, AUTOSAR-M5_0_16-b, AUTOSAR-M5_0_17-a, AUTOSAR-M5_0_18-a, AUTOSAR-M5_2_8-a, AUTOSAR-M7_1_2-c, AUTOSAR-M9_3_3-a |
Coding Conventions for C++ | CODSTA-CPP-101, CODSTA-CPP-43, CODSTA-CPP-50, CODSTA-CPP-53, CODSTA-CPP-53_b, CODSTA-CPP-58, CODSTA-CPP-78, CODSTA-CPP-84 |
Coding Conventions for Modern C++ | CODSTA-MCPP-04, CODSTA-MCPP-13_b, CODSTA-MCPP-14, CODSTA-MCPP-17, CODSTA-MCPP-47 |
Coding Conventions for Modern C | CODSTA-MC-101 |
Coding Conventions | CODSTA-04, CODSTA-122_a, CODSTA-185_a, CODSTA-185_b, CODSTA-224, CODSTA-227, CODSTA-301, CODSTA-302, CODSTA-55, CODSTA-65, CODSTA-89 |
Common Weakness Enumeration | CWE-119-a, CWE-119-e, CWE-125-a, CWE-190-g, CWE-787-a, CWE-787-d |
DISA ASD STIG | APSC_DV-002590-b, APSC_DV-002590-d |
Exceptions | EXCEPT-12 |
Flow Analysis | BD-CO-ITMOD, BD-PB-ARRAY, BD-PB-BYTEORD, BD-PB-CC, BD-PB-NOEXCEPT, BD-PB-NOTINIT, BD-PB-OVERFNZT, BD-PB-OVERFWR, BD-PB-OVERLAP, BD-PB-POVR, BD-PB-PTRARR, BD-PB-PTRCMP, BD-PB-PTRSUB, BD-PB-STREAMINOUT, BD-PB-SUBSEQFWRD, BD-PB-SUBSEQMOVE, BD-PB-VOVR, BD-PB-ZERO |
Formatting | FORMAT-47_b |
Global Static Analysis | GLOBAL-ONEUSEVAR , GLOBAL-UNUSEDFUNC, GLOBAL-UNUSEDTYPE |
High Integrity C++ | HICPP-13_1_2-a, HICPP-13_2_2-a, HICPP-14_2_1-a, HICPP-15_3_2-c, HICPP-17_3_2-a, HICPP-1_2_1-b, HICPP-1_2_1-i, HICPP-2_5_3-a, HICPP-3_1_1-d, HICPP-3_5_1-c, HICPP-3_5_1-d, HICPP-5_2_1-a, HICPP-5_5_1-a, HICPP-5_8_1-a, HICPP-6_1_3-a, HICPP-6_3_2-a, HICPP-6_4_1-a, HICPP-7_1_2-a, HICPP-7_1_2-b, HICPP-7_4_1-a, HICPP-8_1_1-a, HICPP-8_4_1-a, HICPP-9_1_1-a, HICPP-9_1_4-a |
Joint Strike Fighter | JSF-019, JSF-039_a, JSF-070.1_b, JSF-104, JSF-114, JSF-115_a, JSF-117.1, JSF-135_d, JSF-136_b, JSF-148, JSF-170, JSF-171, JSF-186_b, JSF-186_h, JSF-203 |
Memory and Resource Management | MRM-31_b |
MISRA C 1998 | MISRA-051, MISRA-071_a, MISRA-071_b, MISRA-084, MISRA-121_a |
MISRA C 2004 | MISRA2004-13_7_s, MISRA2004-13_7_t, MISRA2004-13_7_u, MISRA2004-13_7_v, MISRA2004-14_1_b, MISRA2004-16_8, MISRA2004-16_8_b, MISRA2004-17_5, MISRA2004-19_14, MISRA2004-8_1_a, MISRA2004-8_1_b |
MISRA C 2012 (Legacy) | MISRA2012-DIR-4_1_a, MISRA2012-DIR-4_1_c, MISRA2012-DIR-4_1_e, MISRA2012-DIR-4_1_h, MISRA2012-DIR-4_1_i, MISRA2012-DIR-4_1_j, MISRA2012-RULE-11_8, MISRA2012-RULE-12_1_a, MISRA2012-RULE-12_2_b, MISRA2012-RULE-14_3_zc, MISRA2012-RULE-17_3, MISRA2012-RULE-17_4, MISRA2012-RULE-17_4_b, MISRA2012-RULE-17_7_a, MISRA2012-RULE-18_1_a, MISRA2012-RULE-18_1_c, MISRA2012-RULE-18_2, MISRA2012-RULE-18_3, MISRA2012-RULE-18_5, MISRA2012-RULE-19_1_c, MISRA2012-RULE-1_3_a, MISRA2012-RULE-1_3_b, MISRA2012-RULE-1_3_e, MISRA2012-RULE-20_11, MISRA2012-RULE-20_8, MISRA2012-RULE-21_17_a, MISRA2012-RULE-21_17_b, MISRA2012-RULE-21_19_a, MISRA2012-RULE-21_19_b, MISRA2012-RULE-22_13, MISRA2012-RULE-2_1_b, MISRA2012-RULE-2_2_b, MISRA2012-RULE-9_1 |
MISRA C 2023 (MISRA C 2012) | MISRAC2012-DIR_4_1-a, MISRAC2012-DIR_4_1-c, MISRAC2012-DIR_4_1-e, MISRAC2012-DIR_4_1-h, MISRAC2012-DIR_4_1-i, MISRAC2012-DIR_4_1-j, MISRAC2012-RULE_11_8-a, MISRAC2012-RULE_12_1-a, MISRAC2012-RULE_12_2-b, MISRAC2012-RULE_14_3-ac, MISRAC2012-RULE_17_3-a, MISRAC2012-RULE_17_4-a, MISRAC2012-RULE_17_4-b, MISRAC2012-RULE_17_7-a, MISRAC2012-RULE_18_1-a, MISRAC2012-RULE_18_1-c, MISRAC2012-RULE_18_2-a, MISRAC2012-RULE_18_3-a, MISRAC2012-RULE_18_5-a, MISRAC2012-RULE_19_1-c, MISRAC2012-RULE_1_3-a, MISRAC2012-RULE_1_3-b, MISRAC2012-RULE_1_3-e, MISRAC2012-RULE_20_11-a, MISRAC2012-RULE_20_8-a, MISRAC2012-RULE_21_17-a, MISRAC2012-RULE_21_17-b, MISRAC2012-RULE_21_19-a, MISRAC2012-RULE_21_19-b, MISRAC2012-RULE_22_13-a, MISRAC2012-RULE_2_1-b, MISRAC2012-RULE_2_2-b, MISRAC2012-RULE_9_1-a |
MISRA C++ 2008 | MISRA2008-0_1_10, MISRA2008-0_1_10_b, MISRA2008-0_1_1_b, MISRA2008-0_1_2_aa, MISRA2008-0_1_2_sz, MISRA2008-0_1_2_u, MISRA2008-0_1_2_v, MISRA2008-0_1_2_w, MISRA2008-0_1_3_c, MISRA2008-0_1_4, MISRA2008-0_1_5, MISRA2008-0_1_6, MISRA2008-0_1_7, MISRA2008-0_3_1_a, MISRA2008-0_3_1_c, MISRA2008-0_3_1_e, MISRA2008-0_3_1_h, MISRA2008-0_3_1_i, MISRA2008-0_3_1_j, MISRA2008-14_7_3, MISRA2008-15_1_2, MISRA2008-15_5_2_b, MISRA2008-15_5_3_l, MISRA2008-16_1_1, MISRA2008-3_1_1, MISRA2008-3_4_1_a, MISRA2008-3_4_1_b, MISRA2008-5_0_16_a, MISRA2008-5_0_16_b, MISRA2008-5_0_17, MISRA2008-5_0_18, MISRA2008-5_0_19, MISRA2008-5_2_8, MISRA2008-7_1_1, MISRA2008-7_1_1_b, MISRA2008-7_1_2_b, MISRA2008-8_4_3, MISRA2008-9_3_2_a, MISRA2008-9_3_2_b, MISRA2008-9_3_3 |
Object Oriented | OOP-12, OOP-36 |
Optimization | OPT-01, OPT-03, OPT-05, OPT-30 |
OWASP API Security Top 10 (2019) | OWASP2019-API3-b, OWASP2019-API3-e, OWASP2019-API3-g |
Physical File Organization | PFO-01 |
Possible Bugs | PB-20, PB-73 |
Preprocessor | PREPROC-16, PREPROC-19 |
Security | SECURITY-09 |
SEI CERT C++ | CERT_CPP-CTR51-a, CERT_CPP-CTR54-b, CERT_CPP-CTR54-c, CERT_CPP-DCL60-a, CERT_CPP-ERR50-m, CERT_CPP-EXP53-a, CERT_CPP-EXP61-a, CERT_CPP-EXP63-a, CERT_CPP-FIO50-a, CERT_CPP-MSC52-a, CERT_CPP-OOP51-a, CERT_CPP-STR50-b, CERT_CPP-STR50-c |
SEI CERT C | CERT_C-API01-a, CERT_C-ARR30-a, CERT_C-ARR36-a, CERT_C-ARR36-b, CERT_C-ARR38-b, CERT_C-ARR38-d, CERT_C-ARR39-a, CERT_C-DCL00-a, CERT_C-DCL00-b, CERT_C-DCL19-a, CERT_C-DCL22-a, CERT_C-ENV01-c, CERT_C-ENV30-a, CERT_C-ERR07-b, CERT_C-EXP08-b, CERT_C-EXP12-a, CERT_C-EXP33-a, CERT_C-EXP37-d, CERT_C-FIO37-a, CERT_C-FIO39-a, CERT_C-FLP03-a, CERT_C-INT13-a, CERT_C-INT33-a, CERT_C-MSC07-b, CERT_C-MSC12-b, CERT_C-MSC12-j, CERT_C-MSC14-a, CERT_C-MSC15-a, CERT_C-MSC19-a, CERT_C-MSC37-a, CERT_C-POS30-a, CERT_C-POS39-a, CERT_C-POS54-a, CERT_C-STR03-a, CERT_C-STR31-a, CERT_C-STR31-b, CERT_C-STR32-a |
Template | TEMPL-10 |
Removed Rules
Rule ID | Notes |
---|---|
AUTOSAR-M0_1_3-b | Removed from AUTOSAR C++ 14 configuration. For other configurations, OPT-06 can be used as a replacement. |
CERT_C-ERR33-b | Removed from CERT C configuration. For other configurations, CODSTA-122_b can be used as a replacement. |
JSF-117_a | Removed from JSF configuration. For other configurations, PB-20 can be used as a replacement. |
MISRA2008-0_1_3_b | Removed from MISRA C++ 2008 configuration. For other configurations, OPT-06 can be used as a replacement. |
MISRA2012-RULE-12_1_b | Removed from MISRA C 2012 (Legacy) configuration. For other configurations, MISRA2004-12_5 can be used as a replacement. |
MISRAC2012-RULE_12_1-b | Removed from MISRA C 2023 (MISRA C 2012) configuration. For other configurations, MISRA2004-12_5 can be used as a replacement. |
MISRACPP202X (all rules) | MISRA C++ 2023 rules should be used instead. |