This release includes the following enhancements:

Release date: May 31, 2023

Enhanced Automotive Compliance Pack

  • MISRA C:2012 rule set has been extended with new and updated rules from the "MISRA C:2012 Amendment 4".

In addition, following the introduction of the "MISRA C:2023" document, which consolidates MISRA C:2012 and all amendments, including amendment 4, the built-in "MISRA C 2012" test configuration was renamed to "MISRA C 2023 (MISRA C 2012)". This configuration includes all MISRA C:2023 / MISRA C:2012 with Amendment 4 rules provided by Parasoft C/C++test.

Note: to keep compatibility and continuity of the compliance processes, the rule identifiers were not changed, and the "MISRAC2012" prefix will still be used for all MISRA C:2023 / MISRA C:2012 with Amendment 4 rules (e.g. "MISRAC2012-RULE_11_10-a").

  • HIS Source Code Metrics configuration has been extended with Number of paths (PATH) / METRICS-44.

Enhanced Static Analysis

  • Performance of the Flow Analysis engine has been enhanced.
  • General enhancements to the accuracy of static analysis rules.
  • 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.

Support for Platforms

Windows Server 2022 is now supported by C/C++test. 

Support for Compilers

The following compilers are now supported:

Compiler NameCompiler Identifier
GNU GCC 12 for x86-64gcc_12-64
GNU GCC 12 for aarch64/arm64gcc_12-aarch64
GNU GCC 11 for aarch32/armgcc_11-aarch32
GNU GCC 10 for aarch32/armgcc_10-aarch32
GNU GCC 9 for aarch64/arm64gcc_9-aarch64
GNU GCC 9 for aarch32/armgcc_9-aarch32
GNU GCC 8 for aarch32/armgcc_8-aarch32
Hexagon 8.6hexagon-clang_8_6
WindRiver Clang/ARM 9.0wrclang_9_0-x86_64, wrclang_9_0-aarch32

Additionally, support for Microsoft Visual C++ Compiler 17.4 has been enhanced.

See Compilers.

Updated Test Configurations

MISRA C 2012 has been updated and renamed to MISRA C 2023 (MISRA C 2012).

The following test configurations have been updated with new rules:

  • AUTOSAR C++14 Coding Guidelines
  • Flow Analysis Aggressive
  • Flow Analysis Fast
  • Flow Analysis Standard
  • Global Analysis
  • High Integrity C++
  • HIS Source Code Metrics
  • Joint Strike Fighter
  • MISRA C 1998
  • MISRA C 2004
  • MISRA C 2012 > MISRA C 2023 (MISRA C 2012)
  • MISRA C++ 2008
  • Recommended Rules for FDA (C)
  • Recommended Rules for FDA (C++)
  • Recommended Rules
  • SEI CERT C Guidelines
  • SEI CERT C Rules
  • SEI CERT C++ Rules
  • Sutter-Alexandrescu

Additional Updates

  • Integration with Bazel builds for Linux is now supported. See Integrating with Bazel.
  • Improved look and feel when running in dark theme for Eclipse IDE.

Deprecated and Removed Support

Removed Support for Team Server

Team Server, which was deprecated in DTP 2022.1, has been removed. If your C/C++test team configurations, rules and rule mappings are still stored in DTP Team Server, migrate them to a shared location. See Migrating Test Configurations, Rules and Rule Mappings from the Team Server to a Shared Location.

Removed Support for Platforms

Support for the following platform is now removed:

  • Windows Server 2016

Compilers to Be Deprecated

Support for the following compilers will be deprecated in future releases:

  • Altium TASKING Vx-toolset for TriCore C/C++ Compiler 6.2
  • Clang 6.0
  • FR Family SOFTUNE C/C++ Compiler V6
  • Green Hills Software Compiler Native v. 5.0
  • Green Hills Software Compiler for ARM64 v. 2014_1.x
  • Green Hills Software Compiler for PPC v. 4.2
  • Green Hills Software Compiler for V850 v. 2014.1.x
  • Microsoft Visual C++ 14.0
  • Microsoft Visual C++ 14.0 (x64)
  • Renesas 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
  • Wind River GCC 4.8.x

Deprecated Compilers

Support for the following compilers is deprecated and will be removed in future releases:

  • Altium TASKING C compiler for 80C196 v. 6.0 r1
  • Clang 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 C/C++ Compiler v. 6.0 for ColdFire
  • 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 STM8 v. 1.4x

Removed Support for Compilers

The following compilers are no longer supported:

  • ARM Clang 6.6
  • ARM GCC 4.5
  • ARM RealView 4.1
  • ARM RealView 4.1 for uVision
  • Altium TASKING Vx-toolset for TriCore C/C++ Compiler 4.0
  • Altium TASKING Vx-toolset for TriCore C/C++ Compiler 6.0
  • Altium TASKING classic compiler for C166/ST10 v. 6.0
  • COSMIC Software 68HC08 C Cross Compiler V4.6.x
  • Clang 3.9
  • Clang 4.0
  • CodeSourcery Sourcery G++ Lite 2009q1-203
  • Embarcadero C++ Compiler 6.2
  • Embarcadero C++ Compiler 6.9
  • GNU GCC 4.0.x (x86)
  • GNU GCC 4.0.x (x86_64)
  • GNU GCC 4.1.x (x86)
  • GNU GCC 4.1.x (x86_64)
  • GNU GCC 4.2.x (x86)
  • GNU GCC 4.2.x (x86_64)
  • GNU GCC 4.3.x (x86)
  • GNU GCC 4.3.x (x86_64)
  • GNU GCC 4.4.x (x86)
  • GNU GCC 4.4.x (x86_64)
  • GNU GCC 4.5.x (x86)
  • GNU GCC 4.5.x (x86_64)
  • GNU GCC 4.6.x (x86)
  • GNU GCC 4.6.x (x86_64)
  • GNU GCC 4.7.x (x86)
  • GNU GCC 4.7.x (x86_64)
  • GNU GCC 4.8.x (x86)
  • GNU GCC 4.8.x (x86_64)
  • GNU GCC 4.9.x (x86)
  • GNU GCC 4.9.x (x86_64)
  • Green Hills Software Compiler Native v. 4.2
  • Green Hills Software Compiler for V850 v. 5.1.x
  • Green Hills Software Compiler for PPC v. 3.5
  • IAR Compiler for ARM v. 6.1x
  • IAR Compiler for ARM v. 6.3x
  • IAR Compiler for ARM v. 6.6x
  • IAR Compiler for ARM v. 6.7x
  • IAR Compiler for MSP430 v. 5.4x
  • Intel(R) C++ Compiler v 18.0
  • Keil C166 7.0
  • Keil C51 8.x
  • Microsoft Visual C++ 11.0
  • Microsoft Visual C++ 11.0 (x64)
  • Microsoft Visual C++ 12.0
  • Microsoft Visual C++ 12.0 (x64)
  • National Instruments LabWindows/CVI 2013 Clang C/C++ Compiler v2.9
  • National Instruments LabWindows/CVI 9.0
  • QNX GCC 4.2.x
  • QNX GCC 4.4.x
  • Renesas M16C/R8C C Compiler 5.4x
  • Renesas RX C/C++ Compiler 2.2x
  • Renesas SH SERIES C/C++ Compiler V.5.1x.x
  • Renesas SH SERIES C/C++ Compiler V.9.03.xx
  • TI ARM C/C++ Compiler v5.1.x
  • TI TMS320C2000 C/C++ Compiler v6.2
  • TI TMS320C6x C/C++ Compiler v7.3

Removed Test Configurations

The following test configurations have been removed:

  • Run Altium TASKING CTC Application with Mem Monitoring - CrossView
  • Run Altium TASKING CTC Tests - CrossView

Resolved Bugs and FRs

Bug/FR ID

Description

CPP-39580

[static] Rules MISRA2012-RULE-5_6 and MISRA2012-RULE-5_7 should be global rules

CPP-40072

[rulewizard] Add support for constexpr if

CPP-42545

[static] CERT-C-FIO41: existing mapping is too general

CPP-42649

[static] Improve mapping for AUTOSAR A2-10-5, MISRA2008 2-10-5 and MISRA C 2012 Rule 5.8 and 5.9

CPP-43932

[static] HIS metric - number of paths (PATH)

CPP-44741

[engine] Constexpr c-tor requires member initialization in non-constant expression context

CPP-44752

[static] CODSTA-145 (CERT_C-POS30-c) could have an exception for buffers initialized by '\0'

CPP-44917

[static] Improve mapping for CERT MEM02

CPP-45439

[static] AUTOSAR-A2_10_5_a should not check static local variables

CPP-46011

[static] Improve mapping for CERT-ERR33 and CERT-POS54

CPP-46408

[static] CERT_C-CON33-a: review list of functions in SECURITY-25 rule

CPP-47128

[static] MISRAC2012-RULE_5_9-a reports incorrect violation on objects with no linkage

CPP-47470

[static] CODSTA-127 and CODSTA-127_b can be extended to detect conversions from array type to integer type

CPP-47508

[static] MISRA2008-5_0_10 rule does not follow exception from MISRA C++ Rule 5-0-10

CPP-47804

[static] CODSTA-203 should not detect strings used in std::cout

CPP-47863

[engine] incorrect reconstruction of cast in designated initializer

CPP-48197

[static] Improve mapping for AUTOSAR A8-4-7

CPP-49197

[static] Improve definition of POD in OOP-48 (AUTOSAR-M11_0_1-a)

CPP-49771

[static] Improve mapping for AUTOSAR A5-2-2

CPP-49849

[static] AUTOSAR A3-9-1: Consider do not report on plain char types used for characters

CPP-49917

[static] Mapping for CERT_C-EXP36 should be improved

CPP-50105

[static] Show the undefined character in AUTOSAR A2-3-1

CPP-50174

[static] Improve mapping for CERT_C-POS44

CPP-51175

[engine] Parse error due to edg.implicit_typename_enabled=true

CPP-51288

[engine] error: qualified name is not allowed

CPP-51304

[engine] cpptestcc error: no instance of overloaded function "vfc::slerp" matches the argument list

CPP-51452

[rulewizard] Expressions in _Static_assert should be detected by static analysis rules

CPP-51594

[compiler] Support for GNU GCC 10 aarch32/arm

CPP-51687

[static] GLOBAL-UNUSEDTYPE (MISRA2008-0_1_5) reports false positive on aliases that are used

CPP-51753

[compiler] Support for WindRiver Clang/ARM 9.0.1 and VxWorks 7.0 SR 640 for Linux (extended)

CPP-51767

[static] MISRA2004-11_3_a (AUTOSAR-M5_2_9-a) should have an exception for uintptr_t and intptr_t types.

CPP-51773

[compiler] Support for GNU GCC 11 aarch32/arm

CPP-51843

[compiler] Parsing error for static asm procedure and 'rvct_5_0_uV'

CPP-51853

[static] MISRA2004-8_7 (AUTOSAR-M3_4_1-b) reports false positive when variable is used in template function

CPP-51854

[static] EXCEPT-17 (AUTOSAR-M15_3_6-a) reports false positive violations on nested try-catch blocks

CPP-52158

[engine] CWC internal error: assertion failed at: "exprutil.c", line 17859 in alloc_expr_ctor_dynamic_init

CPP-52163

[compiler] Parsing error for '_packed_' attribute with TASKING-6.3

CPP-52185

[static] The BD-PB-UCMETH rule should be added into mapping for MISRAC2012-RULE_2_1

CPP-52188

[static] Improve mapping for CERT_C-EXP20

CPP-52196

[static] MISRAC2012-RULE_10_1-a (CODSTA-161_a) should detect when a pointer is the operand of a logical operator

CPP-52212

[engine] Instrumentation error: final specifier on templated class not reconstructed

CPP-52222

[ide] build.id value passed to C+test Engine (Standard) started by C+test Professional should be calculated using session start time - not current time

CPP-52242

[static] Improve mapping for CERT-MSC07_C and CERT-MSC12_C

CPP-52250

[engine] CRTP C++ technique instrumentation failure

CPP-52260

[engine] Cannot collect Coverage for out-of-body template method definition for template class specialization.

CPP-52264

[static] PB-69 reports python errors

CPP-52266

[static] CODSTA-CPP-92 (MISRA2008-10_2_1) reports false positive for assignment operator

CPP-52274

[rulewizard] Typedefs are not visible when it is used to call a constructor

CPP-52302

[compiler] Windows style paths inside of iccarm response files are being evaluated when they shouldn't be

CPP-52322

[static] Improve mapping for CERT-C INT10

CPP-52338

[static] GLOBAL-UNUSEDTYPE (MISRA2008-0_1_5) reports false positive on aliases that are actually used

CPP-52344

[static] MISRA2008-2_10_6_a (CODSTA-CPP-87_a) false positive: rule complains about conflicting identifiers between class name and its constructor name

CPP-52345

[static] CERT_CPP-DCL60-a (GLOBAL-UNIQUETYPE) false positive: complains that class and its constructor have the same name

CPP-52351

[engine] error: expression must have a constant value

CPP-52372

[compiler] Support for Hexagon 8.6 (Linux, Extended, Full)

CPP-52384

[rulewizard] Using declaration doesn't see entity->MemberFunction for template base classes

CPP-52385

[rulewizard] Deduction guide should not be detected as function definition

CPP-52386

[engine] Add enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang to recognized options for clang compilers

CPP-52416

[static] Line Suppression inconsistency

CPP-52483

[docs] Document CPPTEST_MULTI_PROCESSES_LOG configuration macro

CPP-52515

[static] OPT-32_b (MISRA2008-0_1_8_b) reports false positives on template functions containing only static_assert expression

CPP-52521

[engine] Incorrect instrumentation

CPP-52530

[static] GLOBAL-UNUSEDTYPE (MISRA2008-0_1_5) reports false positives on local structs used only as template arguments

CPP-52538

[rulewizard] Expressions in _Static_assert in template instances should be detected by static analysis rules

CPP-52544

[static] Split the CODSTA-CPP-53 (AUTOSAR-A7_1_1-a) rule (check parameters separately)

CPP-52558

[engine] error: 'key_only' is not captured

CPP-52577

[static] NAMING-47 (MISRA2008-2_10_1) does not report when identifiers differs by specific combinations of characters

CPP-52578

[static] OPT-03 (AUTOSAR-A0_1_4-a) reports false positive when a parameter is only used in decltype()

CPP-52581

[static] CODSTA-26 (HICPP-5_1_1-a) reports false positive on hardcoded value in initializer of const/constexpr used in template

CPP-52593

[static] MISRA2004-16_8 (AUTOSAR-A8_4_2-a) reports false positives on functions with 'return' in 'if constexpr'

CPP-52599

[engine] Error[Pe265]: member "A::c_numberOfA" (declared at line 19) is inaccessible

CPP-52602

[static] MISRA2004-17_5 (MISRAC2012-RULE_18_5-a) reports false positive on pointers to arrays in function parameters

CPP-52603

[static] MISRA2004-16_7 (MISRAC2012-RULE_8_13-a) reports false positive on pointers to array types

CPP-52623

[static] CODSTA-CPP-78 (MISRA2008-9_3_3) reports false positive when a function contains non-static code inside 'if constexpr'

CPP-52625

[static] CODSTA-81 (MISRA2008-3_3_2) reports false positive when a function is declared in indirect unnamed namespace

CPP-52648

[rulewizard] Expressions in decltype() should be detected by static analysis rules

CPP-52656

[static] MISRA2004-14_3 (AUTOSAR-M6_2_3-a) reports when [[fallthrough]] attribute is in the same line as null statement

CPP-52659

[static] MISRA2004-17_6_a (AUTOSAR-A3_8_1-b) reports false positive when an address to for-range element is returned

CPP-52669

[static] An error has occurred while running the rule 'INTERNAL-METRICS-METHODS2

CPP-52674

[engine] Reference not available in lambda without capture

CPP-52702

[engine] error: expression must have a constant value

CPP-52736

[static] CODSTA-MCPP-37 (AUTOSAR-A12_1_6-a) reports false positive when constructor in derived class initializes members

CPP-52743

[static] INIT-18 (AUTOSAR-A12_1_2-a) reports false positive when static member is assigned in constructor

CPP-52745

[engine] error: invalid cast from type '__m128i {aka __vector(2) long long int}' to type 'cv_ void_ptr {aka const volatile void*}'

CPP-52760

[static] MISRA2008-5_2_10 detects non-arithmetics operators

CPP-52769

[engine] Add support for __va_list type for aarch64

CPP-52797

[compiler] Incorrect parsing of --utf8_text_in option for IAR compilers

CPP-52819

[static] OOP-07 (AUTOSAR-A10_1_1-a) does not detect correctly interface classes

CPP-52825

[engine] no instance of function template "f" matches the argument list

CPP-52831

[static] GLOBAL-ONEUSEVAR (MISRA2008-0_1_4) reports false positive when variable is used in static_assert in template

CPP-52839

[static] Improve mapping for AUTOSAR A8-4-3

CPP-52875

[static] Improve mapping for MISRAC2012-RULE-12_2 rule

CPP-52876

[static] GLOBAL-ONEFILEDECL (AUTOSAR-M3_2_3) reports false positive on enum forward declaration

CPP-52877

[static] PB-41_b reports false positive when braced initializer with 'std::initializer_list' is used

CPP-52879

[compiler] Clang 10 invalid alignment value specified by attribute

CPP-52890

[compiler] error C3615: constexpr function 'operator new' cannot result in a constant expression

CPP-52892

[static] CODSTA-CPP-103 (AUTOSAR-A8_4_8-a) reports false positive when parameter is used in constructor init list

CPP-52977

[static] CODSTA-224 (AUTOSAR-A5_16_1-a) reports false positive on conditional operator used in template member initializer

CPP-52984

[engine] GCC allows "weak" string to be constexpr

CPP-53007

[ide] Update the title with the information using "collapse all" link on test case editor

CPP-53070

[static] CODSTA-184 reports IndexError: list index out of range

CPP-53100

[cli] C/C++test Standard CLI crashes on GoogleTest reports that have skipped tests

CPP-53683

[ide] Issue when editing "Stub Configuration" in the test case editor with "Code"

FA-4985

BD-PB-CC false positives on conditions whose value depends on the template parameter

FA-9225

Behavior of BD-PB-VOVR's "Report when there is at least one path..." parameter does not fit its description

FA-9261

BD-PB-CC false negative when checking out-of-range value for equality

FA-9265

Model for failed dynamic_cast on reference type incorrectly throwing 'int' instead of 'std::bad_cast'

FA-9335

BD-PB-ZERO false positive in sensitive mode when divisor is casted

FA-9368

BD-PB-NOTINIT false positive

PT-1350cpptest.license.wait.for.tokens.time not waiting when Command Line feature not found
PT-1704[ VS ] No proxy support in Visual Studio plugin
PT-1727

"Start deactivated, release automatically when idle" not working

XT-41092Relative paths to rule links are resolved to absolute making reports and rule docs non-portable 
CPP-52820*[engine] Instrumentation error: Expression must have a constant value instrumentation failure
CPP-53718*[engine] constexpr __builtin_strcmp/__builtin_memcmp causes memory buffer overrun
CPP-53785*[static] OPT-43: IndexError: string index out of range
XT-41178*Support for Gitlab SAST v.15 report format

*Available in C/C++test 2023.1.1 or newer

Updates to Rules

New Rules

Rule ID

Header

APSC_DV-002590-l

Avoid signed integer overflows

AUTOSAR-A2_10_5-c

Identifiers that define objects with internal linkage shall be unique

AUTOSAR-A2_10_5-d

Identifiers that define functions with internal linkage shall be unique

AUTOSAR-A3_9_1-c

A typedef should be used in place of the plain char type

AUTOSAR-A4_7_1-i

Avoid data loss when converting between integer types

AUTOSAR-A4_7_1-j

Avoid signed integer overflows

AUTOSAR-A4_7_1-k

Avoid value change when converting between integer types

AUTOSAR-A7_1_1-b

Declare parameters as const whenever possible

AUTOSAR-M0_1_3-d

A project should not contain unused variables with external linkage

AUTOSAR-M0_1_3-e

A project should not contain unused variables with internal linkage

BD-PB-INTDL

Avoid data loss when converting between integer types

BD-PB-INTUB

Avoid signed integer overflows

BD-PB-INTVC

Avoid value change when converting between integer types

BD-PB-INTWRAP

Avoid wraparounds when performing arithmetic integer operations

BD-PB-NOTINITAT

Atomic objects shall be properly initialized before being accessed

BD-TRS-THRDR

There shall be no data races between threads

BD-TRS-THRDSTR

A thread synchronization object should not be destroyed by a thread

BD-TRS-THRINIT

A thread synchronization object should not be initialized by a thread

BD-TRS-THRTHR

A thread should not be created by another thread

BD-TRS-THRTSS

A thread-specific storage should not be created by a thread

BD-TRS-TIMEDLOCK

The Standard Library function mtx_timedlock() shall not be invoked on a mutex that does not support timeout

CERT_C-DCL00-b

Declare parameters as const whenever possible

CERT_C-EXP20-b

Tests of a value against zero should be made explicit, unless the operand is effectively Boolean

CERT_C-INT08-b

Avoid signed integer overflows

CERT_C-INT08-c

Avoid value change when converting between integer types

CERT_C-INT08-d

Avoid wraparounds when performing arithmetic integer operations

CERT_C-INT31-p

Avoid value change when converting between integer types

CERT_C-MSC07-i

Avoid unreachable methods

CERT_C-MSC12-i

Avoid unreachable methods

CERT_C-MSC12-j

Avoid conditions that always evaluate to the same value

CERT_C-MSC12-k

All non-null statements shall either have at least one side-effect however executed or cause control flow to change

CODSTA-112_b

Pointers to variably-modified array types should not be used

CODSTA-220_b

The small integer variants of the minimum-width integer constant macros should not be used

CODSTA-223_b

A typedef should be used in place of the plain char type

CODSTA-226_a

The value returned by a standard library function that may return an error should be used

CODSTA-226_b

The standard library functions for which return values need not be checked should be cast to 'void'

CODSTA-227

The value returned by a POSIX library function that may return an error should be used

CODSTA-228_a

Do not call 'getc()', 'putc()', 'getwc()', or 'putwc()' with a stream argument containing assignments, increment or decrement operators

CODSTA-228_b

Do not call 'getc()', 'putc()', 'getwc()', or 'putwc()' with a stream argument containing function calls or function-like macro calls

CODSTA-229

The operands of the remainder operator '%' should be of unsigned integer types

CODSTA-230

Do not cast pointers into more strictly aligned pointer types

CODSTA-231

The address of an object with thread storage duration shall not be assigned to an object with static storage duration

CODSTA-232

The increment (++) and decrement (--) operators should not be mixed with arithmetic operators in an expression

CODSTA-301

A conversion shall not remove any 'const', 'volatile' or '_Atomic' qualification from the type pointed to by a pointer

CODSTA-302

The right-hand operand of a constant expression shift operator shall lie between zero and one less than the width in bits of the essential type of the left-hand operand

CODSTA-CPP-108

A parameter of const reference to a 'cheap to copy' type should be passed by value

CODSTA-CPP-108_b

Pass small objects with a trivial copy constructor by value

CODSTA-CPP-109

A parameter of a type that is not 'cheap to copy' should be passed by reference

CODSTA-CPP-53_b

Declare parameters as const whenever possible

CODSTA-MC-101

Thread objects, thread synchronization objects and thread-specific storage pointers shall not have automatic storage duration

CODSTA-MC-16

The '_Atomic' qualifier should not be used with the 'void' type

CODSTA-MC-17

Members of atomic objects of structure and union types should not be directly accessed

CODSTA-MC-18

A cast shall not remove any '_Atomic' qualification from the type of a pointer

CODSTA-MC-19

The value of an expression with atomic type should be independent from thread interleaving

CODSTA-MC-20

Only 'memory_order_seq_cst' should be used as an explicit memory order argument

CODSTA-MC-21

The second argument passed to the 'mtx_init()' function call should be either 'mtx_plain', 'mtx_timed', 'mtx_plain | mtx_recursive', or 'mtx_timed | mtx_recursive'

CODSTA-MC-22

Thread objects, thread synchronization objects, and thread-specific storage pointers shall only be accessed by the appropriate Standard Library functions

CWE-190-h

Avoid signed integer overflows

GLOBAL-REUSEDEXTFUN

Identifiers that define functions with external linkage shall be unique

GLOBAL-REUSEDEXTVAR

Identifiers that define objects with external linkage shall be unique

GLOBAL-REUSEDSTATFUN

Identifiers that define functions with internal linkage shall be unique

GLOBAL-REUSEDSTATVAR

Identifiers that define objects with internal linkage shall be unique

GLOBAL-UNIQUETYPEC

A tag name shall be a unique identifier

GLOBAL-UNIQUETYPEDEFC

A typedef name shall be a unique identifier

GLOBAL-UNUSEDEXTVAR

A project should not contain unused variables with external linkage

HICPP-4_2_2-g

Avoid data loss when converting between integer types

HICPP-4_2_2-h

Avoid signed integer overflows

HICPP-4_2_2-i

Avoid value change when converting between integer types

HICPP-7_1_2-b

Declare parameters as const whenever possible

METRICS-44

The number of execution paths in a function should not be higher than 80

MISRA2008-0_1_3_d

A project should not contain unused variables with external linkage

MISRA2008-0_1_3_e

A project should not contain unused variables with internal linkage

MISRA2008-2_10_5_c

The identifier name of a non-member object or function with static storage duration should not be reused

MISRA2008-2_10_5_d

The identifier name of a non-member object or function with static storage duration should not be reused

MISRA2008-7_1_1_b

Declare parameters as const whenever possible

MISRA2012-DIR-4_1_l

Avoid signed integer overflows

MISRA2012-DIR-4_1_m

Avoid data loss when converting between integer types

MISRA2012-DIR-5_1

Do not use global variable with different locks set

MISRA2012-DIR-5_1_b

Variable should be used in context of single critical section

MISRA2012-DIR-5_1_c

There shall be no data races between threads

MISRA2012-DIR-5_2

Do not acquire locks in different order

MISRA2012-DIR-5_3

A thread should not be created by another thread

MISRA2012-RULE-11_10

The _Atomic qualifier shall not be applied to the incomplete type void

MISRA2012-RULE-12_2_b

The right-hand operand of a constant expression shift operator shall lie between zero and one less than the width in bits of the essential type of the left-hand operand

MISRA2012-RULE-12_6

Structure and union members of atomic objects shall not be directly accessed

MISRA2012-RULE-13_2_h

The value of an expression with atomic type should be independent from thread interleaving

MISRA2012-RULE-18_10

Pointers to variably-modified array types should not be used

MISRA2012-RULE-18_6_c

The address of an object with thread storage duration shall not be assigned to an object with static storage duration

MISRA2012-RULE-21_25

Only 'memory_order_seq_cst' should be used as an explicit memory order argument

MISRA2012-RULE-21_26

The Standard Library function mtx_timedlock() shall not be invoked on a mutex that does not support timeout

MISRA2012-RULE-22_11

Do not join or detach a thread that was previously joined or detached

MISRA2012-RULE-22_12

Thread objects, thread synchronization objects, and thread-specific storage pointers shall only be accessed by the appropriate Standard Library functions

MISRA2012-RULE-22_13

Thread objects, thread synchronization objects and thread-specific storage pointers shall not have automatic storage duration

MISRA2012-RULE-22_14_a

A thread synchronization object should not be initialized by a thread

MISRA2012-RULE-22_14_b

The second argument passed to the 'mtx_init()' function call should be either 'mtx_plain', 'mtx_timed', 'mtx_plain | mtx_recursive', or 'mtx_timed | mtx_recursive'

MISRA2012-RULE-22_15

A thread synchronization object should not be destroyed by a thread

MISRA2012-RULE-22_16

Do not abandon unreleased locks

MISRA2012-RULE-22_17

Do not release a lock that has not been acquired

MISRA2012-RULE-22_18

Avoid double locking

MISRA2012-RULE-22_19

A condition variable shall be associated with at most one mutex variable

MISRA2012-RULE-22_20

A thread-specific storage should not be created by a thread

MISRA2012-RULE-2_1_h

Avoid unreachable methods

MISRA2012-RULE-2_8_a

A project should not contain unused variables with external linkage

MISRA2012-RULE-2_8_b

A project should not contain unused variables with internal linkage

MISRA2012-RULE-2_8_c

Avoid unused local variables

MISRA2012-RULE-5_8_b

Identifiers that define functions with external linkage shall be unique

MISRA2012-RULE-7_6

The small integer variants of the minimum-width integer constant macros should not be used

MISRA2012-RULE-9_6

An initializer using chained designators shall not contain initializers without designators

MISRA2012-RULE-9_7

Atomic objects shall be properly initialized before being accessed

MISRAC2012-DIR_4_1-l

Avoid signed integer overflows

MISRAC2012-DIR_4_1-m

Avoid data loss when converting between integer types

MISRAC2012-DIR_5_1-a

Do not use global variable with different locks set

MISRAC2012-DIR_5_1-b

Variable should be used in context of single critical section

MISRAC2012-DIR_5_1-c

There shall be no data races between threads

MISRAC2012-DIR_5_2-a

Do not acquire locks in different order

MISRAC2012-DIR_5_3-a

A thread should not be created by another thread

MISRAC2012-RULE_11_10-a

The '_Atomic' qualifier should not be used with the 'void' type

MISRAC2012-RULE_12_2-b

The right-hand operand of a constant expression shift operator shall lie between zero and one less than the width in bits of the essential type of the left-hand operand

MISRAC2012-RULE_12_6-a

Members of atomic objects of structure and union types should not be directly accessed

MISRAC2012-RULE_13_2-h

The value of an expression with atomic type should be independent from thread interleaving

MISRAC2012-RULE_18_10-a

Pointers to variably-modified array types should not be used

MISRAC2012-RULE_18_6-c

The address of an object with thread storage duration shall not be assigned to an object with static storage duration

MISRAC2012-RULE_21_25-a

Only 'memory_order_seq_cst' should be used as an explicit memory order argument

MISRAC2012-RULE_21_26-a

The Standard Library function mtx_timedlock() shall not be invoked on a mutex that does not support timeout

MISRAC2012-RULE_22_11-a

Do not join or detach a thread that was previously joined or detached

MISRAC2012-RULE_22_12-a

Thread objects, thread synchronization objects, and thread-specific storage pointers shall only be accessed by the appropriate Standard Library functions

MISRAC2012-RULE_22_13-a

Thread objects, thread synchronization objects and thread-specific storage pointers shall not have automatic storage duration

MISRAC2012-RULE_22_14-a

A thread synchronization object should not be initialized by a thread

MISRAC2012-RULE_22_14-b

The second argument passed to the 'mtx_init()' function call should be either 'mtx_plain', 'mtx_timed', 'mtx_plain | mtx_recursive', or 'mtx_timed | mtx_recursive'

MISRAC2012-RULE_22_15-a

A thread synchronization object should not be destroyed by a thread

MISRAC2012-RULE_22_16-a

Do not abandon unreleased locks

MISRAC2012-RULE_22_17-a

Do not release a lock that has not been acquired

MISRAC2012-RULE_22_18-a

Avoid double locking

MISRAC2012-RULE_22_19-a

Do not use more than one mutex for concurrent waiting operations on a condition variable

MISRAC2012-RULE_22_20-a

A thread-specific storage should not be created by a thread

MISRAC2012-RULE_2_1-h

Avoid unreachable methods

MISRAC2012-RULE_2_8-a

A project should not contain unused variables with external linkage

MISRAC2012-RULE_2_8-b

A project should not contain unused variables with internal linkage

MISRAC2012-RULE_2_8-c

Avoid unused local variables

MISRAC2012-RULE_5_8-b

Identifiers that define functions with external linkage shall be unique

MISRAC2012-RULE_7_6-a

The small integer variants of the minimum-width integer constant macros should not be used

MISRAC2012-RULE_9_6-a

An initializer using chained designators shall not contain initializers without designators

MISRAC2012-RULE_9_7-a

Atomic objects shall be properly initialized before being accessed

MRM-58_a

The result of the memory allocation function should be cast immediately

MRM-58_b

The result of the memory allocation function should be cast immediately into a pointer to the allocated type

OOP-07_c

Ensure that a derived class has at most one base class which is not an interface class

OPT-43

A project should not contain unused variables with internal linkage

PB-80

An initializer using chained designators shall not contain initializers without designators

SECURITY-53

The 'pthread_kill', 'pthread_sigqueue' and 'tgkill' functions should not be used to send signals to threads

Updated Rules

Category ID

Rule IDs

DISA ASD STI

APSC_DV-001995-e, APSC_DV-001995-f, APSC_DV-002000-a, APSC_DV-002400-d, APSC_DV-002590-e, APSC_DV-003110-a

AUTOSAR C++14 Coding Guidelines

AUTOSAR-A0_1_1-a, AUTOSAR-A0_1_6-a, AUTOSAR-A10_1_1-a, AUTOSAR-A12_1_2-a, AUTOSAR-A12_1_6-a, AUTOSAR-A12_8_3-a, AUTOSAR-A15_0_2-a, AUTOSAR-A15_1_4-a, AUTOSAR-A15_5_3-j, AUTOSAR-A2_10_4-a, AUTOSAR-A2_10_4-b, AUTOSAR-A2_10_5-a, AUTOSAR-A2_10_5-b, AUTOSAR-A2_3_1-a, AUTOSAR-A3_8_1-a, AUTOSAR-A3_8_1-b, AUTOSAR-A3_9_1-b, AUTOSAR-A4_7_1-h, AUTOSAR-A5_0_3-a, AUTOSAR-A5_16_1-a, AUTOSAR-A5_1_1-a, AUTOSAR-A5_2_2-a, AUTOSAR-A5_2_3-a, AUTOSAR-A5_3_2-a, AUTOSAR-A5_6_1-a, AUTOSAR-A7_1_1-a, AUTOSAR-A7_3_1-a, AUTOSAR-A8_4_2-a, AUTOSAR-A8_4_3-a, AUTOSAR-A8_4_7-a, AUTOSAR-A8_4_8-a, AUTOSAR-A8_5_0-a, AUTOSAR-M0_1_2-ac, AUTOSAR-M0_1_4-a, AUTOSAR-M0_3_1-e, AUTOSAR-M0_3_1-f, AUTOSAR-M10_2_1-a, AUTOSAR-M11_0_1-a, AUTOSAR-M15_3_6-a, AUTOSAR-M2_10_1-a, AUTOSAR-M3_2_3-a, AUTOSAR-M3_3_2-a, AUTOSAR-M3_4_1-b, AUTOSAR-M5_0_10-a, AUTOSAR-M5_2_10-a, AUTOSAR-M5_2_9-a, AUTOSAR-M6_2_3-a, AUTOSAR-M6_4_1-a, AUTOSAR-M7_1_2-b, AUTOSAR-M7_5_1-a

Flow Analysis

BD-PB-BADSHIFT , BD-PB-CC, BD-PB-EXCEPT, BD-PB-NOTINIT, BD-PB-NP, BD-PB-SUBSEQMOVE, BD-PB-UCMETH , BD-PB-VOVR, BD-PB-ZERO, BD-RES-FREE, BD-RES-LEAKS, BD-TRS-MLOCK, BD-TRS-REVLOCK

SEI CERT C

CERT_C-CON30-a, CERT_C-CON31-b, CERT_C-CON33-a, CERT_C-CON43-a, CERT_C-DCL00-a, CERT_C-DCL13-a, CERT_C-DCL22-a, CERT_C-DCL30-a, CERT_C-ERR33-a, CERT_C-ERR33-b, CERT_C-EXP05-a, CERT_C-EXP32-a, CERT_C-EXP33-a, CERT_C-EXP34-a, CERT_C-EXP36-a, CERT_C-EXP40-a, CERT_C-FIO22-a, CERT_C-FIO41-a, CERT_C-FIO41-b, CERT_C-FIO42-a, CERT_C-FIO46-a, CERT_C-FLP03-a, CERT_C-INT08-a, CERT_C-INT10-a, CERT_C-INT30-a, CERT_C-INT31-a, CERT_C-INT31-o, CERT_C-INT32-a, CERT_C-INT33-a, CERT_C-INT34-a, CERT_C-INT36-b, CERT_C-MEM00-d, CERT_C-MEM00-e, CERT_C-MEM01-a, CERT_C-MEM02-a, CERT_C-MEM02-b, CERT_C-MEM12-a, CERT_C-MEM30-a, CERT_C-MEM31-a, CERT_C-MSC09-a, CERT_C-MSC19-b, CERT_C-MSC37-a, CERT_C-MSC41-a, CERT_C-POS30-c, CERT_C-POS44-a, CERT_C-POS48-b, CERT_C-POS53-a, CERT_C-POS54-a, CERT_C-WIN30-a

SEI CERT C++

CERT_CPP-DCL57-b, CERT_CPP-DCL60-a, CERT_CPP-ERR50-j, CERT_CPP-ERR51-a, CERT_CPP-ERR54-a, CERT_CPP-ERR56-a, CERT_CPP-ERR57-a, CERT_CPP-EXP53-a, CERT_CPP-EXP54-a, CERT_CPP-EXP54-b, CERT_CPP-EXP55-a, CERT_CPP-EXP63-a, CERT_CPP-FIO51-a, CERT_CPP-MEM50-a, CERT_CPP-MSC52-a, CERT_CPP-STR51-a

Coding Conventions

CODSTA-112, CODSTA-126, CODSTA-127, CODSTA-127_b, CODSTA-145, CODSTA-161_a, CODSTA-184, CODSTA-203, CODSTA-223, CODSTA-224, CODSTA-26, CODSTA-81

Coding Conventions for C++

CODSTA-CPP-103, CODSTA-CPP-11, CODSTA-CPP-53, CODSTA-CPP-92

Coding Conventions for Modern C++

CODSTA-MCPP-37

Common Weakness Enumeration

CWE-190-a, CWE-362-e, CWE-401-a, CWE-415-a, CWE-416-a, CWE-476-a, CWE-704-d, CWE-704-e, CWE-772-a, CWE-798-a

Exceptions

EXCEPT-17

Global Static Analysis

GLOBAL-CONDMUTEXVAR, GLOBAL-ONEDEFTYPE, GLOBAL-ONEFILEDECL, GLOBAL-ONEUSEVAR, GLOBAL-REUSEDQUALGLOBVAR, GLOBAL-REUSEDQUALSTATFUN, GLOBAL-UNIQUETYPE, GLOBAL-UNIQUETYPEDEF, GLOBAL-UNUSEDTYPE

High Integrity C++

HICPP-10_3_1-a, HICPP-13_1_1-a, HICPP-15_3_2-a, HICPP-18_2_2-a, HICPP-1_2_1-h, HICPP-1_2_1-i, HICPP-2_4_1-a, HICPP-3_4_1-a, HICPP-4_1_1-b, HICPP-4_2_2-e, HICPP-4_2_2-f, HICPP-5_1_1-a, HICPP-5_2_1-c, HICPP-5_4_1-a, HICPP-5_4_1-c, HICPP-5_5_1-a, HICPP-5_8_1-a, HICPP-6_1_1-b, HICPP-6_3_2-a, HICPP-7_1_2-a, HICPP-7_4_2-c, HICPP-7_4_3-a, HICPP-8_4_1-a, HICPP-8_4_1-b

Initialization

INIT-18

Joint Strike Fighter

JSF-009, JSF-059_b, JSF-097_d, JSF-111, JSF-114, JSF-118, JSF-136_a, JSF-151, JSF-164, JSF-170

MISRA C 1998

MISRA-005, MISRA-083

MISRA C 2004

MISRA2004-10_5, MISRA2004-11_3_a, MISRA2004-11_3_b, MISRA2004-11_5, MISRA2004-14_3, MISRA2004-14_9, MISRA2004-16_7, MISRA2004-16_8, MISRA2004-16_8_b, MISRA2004-17_5, MISRA2004-17_6_a, MISRA2004-8_7

MISRA C++ 2008

MISRA2008-0_1_2_aa, MISRA2008-0_1_4, MISRA2008-0_1_5, MISRA2008-0_1_6, MISRA2008-0_3_1_b, MISRA2008-0_3_1_c, MISRA2008-10_2_1, MISRA2008-11_0_1, MISRA2008-15_3_6, MISRA2008-15_5_3_j, MISRA2008-2_10_1, MISRA2008-2_10_3, MISRA2008-2_10_4, MISRA2008-2_10_5_a, MISRA2008-2_10_5_b, MISRA2008-3_2_3, MISRA2008-3_3_2, MISRA2008-3_4_1_b, MISRA2008-5_0_10, MISRA2008-5_0_19, MISRA2008-5_2_10, MISRA2008-5_2_5, MISRA2008-5_2_9, MISRA2008-6_2_3, MISRA2008-6_4_1, MISRA2008-7_1_1, MISRA2008-7_1_2_a, MISRA2008-7_5_1, MISRA2008-7_5_2_a, MISRA2008-8_4_3

MISRA C 2012 (Legacy)

MISRA2012-DIR-4_13_a, MISRA2012-DIR-4_13_b, MISRA2012-DIR-4_13_f, MISRA2012-DIR-4_1_b, MISRA2012-DIR-4_1_c, MISRA2012-DIR-4_1_k, MISRA2012-RULE-10_1_a, MISRA2012-RULE-11_3, MISRA2012-RULE-11_4, MISRA2012-RULE-11_8, MISRA2012-RULE-12_2, MISRA2012-RULE-14_3_zc, MISRA2012-RULE-15_6_b, MISRA2012-RULE-17_4, MISRA2012-RULE-17_4_b, MISRA2012-RULE-18_5, MISRA2012-RULE-18_6_a, MISRA2012-RULE-18_8, MISRA2012-RULE-1_3_a, MISRA2012-RULE-1_3_b, MISRA2012-RULE-1_3_c, MISRA2012-RULE-1_3_m, MISRA2012-RULE-21_16, MISRA2012-RULE-22_1, MISRA2012-RULE-22_2_a, MISRA2012-RULE-22_6, MISRA2012-RULE-2_2_b, MISRA2012-RULE-5_6_a, MISRA2012-RULE-5_7_a, MISRA2012-RULE-5_8, MISRA2012-RULE-5_9_a, MISRA2012-RULE-5_9_b, MISRA2012-RULE-8_13_a, MISRA2012-RULE-8_9, MISRA2012-RULE-9_1, MISRA2012-RULE-9_4

MISRA C 2023 (MISRA C 2012)

MISRAC2012-DIR_4_1-b, MISRAC2012-DIR_4_1-c, MISRAC2012-DIR_4_1-k, MISRAC2012-DIR_4_13-a, MISRAC2012-DIR_4_13-b, MISRAC2012-DIR_4_13-f, MISRAC2012-RULE_10_1-a, MISRAC2012-RULE_11_3-a, MISRAC2012-RULE_11_4-a, MISRAC2012-RULE_11_8-a, MISRAC2012-RULE_12_2-a, MISRAC2012-RULE_14_3-ac, MISRAC2012-RULE_15_6-b, MISRAC2012-RULE_17_4-a, MISRAC2012-RULE_17_4-b, MISRAC2012-RULE_18_5-a, MISRAC2012-RULE_18_6-a, MISRAC2012-RULE_18_8-a, MISRAC2012-RULE_1_3-a, MISRAC2012-RULE_1_3-b, MISRAC2012-RULE_1_3-c, MISRAC2012-RULE_1_3-m, MISRAC2012-RULE_21_16-a, MISRAC2012-RULE_22_1-a, MISRAC2012-RULE_22_2-a, MISRAC2012-RULE_22_6-a, MISRAC2012-RULE_2_2-b, MISRAC2012-RULE_5_6-a, MISRAC2012-RULE_5_7-a, MISRAC2012-RULE_5_8-a, MISRAC2012-RULE_5_9-a, MISRAC2012-RULE_5_9-b, MISRAC2012-RULE_8_13-a, MISRAC2012-RULE_8_9-a, MISRAC2012-RULE_9_1-a, MISRAC2012-RULE_9_4-a

MISRA C++ 202X

MISRACPP202X-0090-a, MISRACPP202X-0097-a, MISRACPP202X-0110-b, MISRACPP202X-0150-a, MISRACPP202X-0152-a, MISRACPP202X-0280-b

Naming Conventions

NAMING-20, NAMING-47

Object Oriented

OOP-07, OOP-48

OWASP Top 10 2017

OWASP2017-A6-a

OWASP Top 10 2019

OWASP2019-API4-b, OWASP2019-API7-b

OWASP Top 10 2021

OWASP2021-A5-a

Possible Bugs

PB-41_b, PB-69

Security

SECURITY-25

STL Best Practices

STL-31, STL-34, STL-35

Removed Rules

Rule ID

Notes

AUTOSAR-A8_4_7-b

Removed from AUTOSAR C++ 14 configuration - replaced with AUTOSAR-A8_4_7-a.

CERT_C-ERR33-c

Removed from CERT C configuration. For other configurations, BD-PB-NP can be used as a replacement.

CERT_C-FIO41-c

Removed from CERT C configuration. For other configurations, MISRA2004-12_2_c can be used as a replacement.

CERT_C-FIO41-d

Removed from CERT C configuration. For other configurations, MISRA2004-12_2_d can be used as a replacement.

CERT_C-FIO41-e

Removed from CERT C configuration. For other configurations, CODSTA-123 can be used as a replacement.

CERT_C-POS54-b

Removed from CERT C configuration. For other configurations, CODSTA-122_b can be used as a replacement.

CERT_C-POS54-c

Removed from CERT C configuration. For other configurations, BD-PB-NP can be used as a replacement.

CODSTA-180

GLOBAL-REUSEDEXTVAR, GLOBAL-REUSEDEXTFUN can be used instead.

HICPP-8_2_3-b

Removed from High Integrity C++ configuration - replaced with HICPP-8_2_3-a

MISRA2012-RULE-1_4_d

Removed from MISRA C 2012 configuration. For other configurations, CODSTA-214 can be used as a replacement.

MISRA2012-RULE-1_4_e

Removed from MISRA C 2012 configuration. For other configurations, CODSTA-209 can be used as a replacement.

MISRA2012-RULE-1_4_f

Removed from MISRA C 2012 configuration. For other configurations, CODSTA-210 can be used as a replacement.

MISRA2012-RULE-1_4_g

Removed from MISRA C 2012 configuration. For other configurations, CODSTA-211 can be used as a replacement.

MISRA2012-RULE-5_6_b

Removed from MISRA C 2012 configuration. For other configurations, MISRA2004-5_3_b can be used as a replacement.

MISRA2012-RULE-5_7_b

Removed from MISRA C 2012 configuration. For other configurations, MISRA2004-5_4_b can be used as a replacement.

MISRAC2012-RULE_1_4-d

Removed from MISRA C 2012 configuration. For other configurations, CODSTA-214 can be used as a replacement

MISRAC2012-RULE_1_4-e

Removed from MISRA C 2012 configuration. For other configurations, CODSTA-209 can be used as a replacement.

MISRAC2012-RULE_1_4-f

Removed from MISRA C 2012 configuration. For other configurations, CODSTA-210 can be used as a replacement.

MISRAC2012-RULE_1_4-g

Removed from MISRA C 2012 configuration. For other configurations, CODSTA-211 can be used as a replacement.

MISRAC2012-RULE_5_6-b

Removed from MISRA C 2012 configuration. For other configurations, MISRA2004-5_3_b can be used as a replacement.

MISRAC2012-RULE_5_7-b

Removed from MISRA C 2012 configuration. For other configurations, MISRA2004-5_4_b can be used as a replacement

  • No labels