Release summary
- New queries added for the following rule packages: Concurrency6, Concurrency7, Concurrency8
- The following changes have been made for this release:
CON34-C
-AppropriateThreadObjectStorageDurations.ql
:- Improved analysis for detecting objects with automatic storage duration
- New reports will include
a.x
,a[x]
for objecta
with automatic storage duration
DCL30-C
-AppropriateStorageDurationsFunctionReturn.ql
:- Improved analysis for detecting objects with automatic storage duration
- New reports will include
a.x
,a[x]
for objecta
with automatic storage duration - False positives related to returning copying pointer values
EXP35-C
-DoNotModifyObjectsWithTemporaryLifetime.ql
:- Improved analysis for detecting objects with temporary lifetime
- More non-lvalue expressions that produce temporary objects detected, for instance
(x = y).x
, previously onlyf().x
discovered
MEM33-C
-AllocStructsWithAFlexibleArrayMemberDynamically.ql
:- Improved analysis for detecting objects with automatic storage duration
- New reports will include struct literals with a flexible array member
RULE-18-9
-ModifiableLValueSubscriptedWithTemporaryLifetime.ql
:- Problems will be reported at more obviously non-lvalue locations
- Implementation refactored to be shared with other libraries
- No other changes expected
RULE-18-9
-ArrayToPointerConversionOfTemporaryLifetime.ql
:- Problems will be reported at more obviously non-lvalue locations
- Implementation refactored to be shared with other libraries
- No other changes expected
Concurrency
- for all queries related to RAII-style mutexes- These types of locks have been refactored to improve performance in some queries. No change in query results expected.
ERR57-CPP
-DoNotLeakResourcesWhenHandlingExceptions.ql
:- Resource leak detection code refactored for sharing across queries
- Control flow no longer uses "cut nodes." This could impact performance positively or negatively, however measurements have been taken that indicate no significant change
- Some false positives have been suppressed due to slightly different control flow approach
- Leaked mutex locks and open files are reported at slightly different location, reported at call site (e.g.
f.open(...)
,m.lock()
) rather than on the variable itself (f
andm
).
A15-1-4
-ValidResourcesStateBeforeThrow.ql
:- Resource leak detection code refactored for sharing across queries
- Control flow no longer uses "cut nodes." This could impact performance positively or negatively, however measurements have been taken that indicate no significant change
- Some false positives have been suppressed due to slightly different control flow approach
- Leaked mutex locks and open files are reported at slightly different location, reported at call site (e.g.
f.open(...)
,m.lock()
) rather than on the variable itself (f
andm
).
A15-4-4
-MissingNoExcept.ql
:- Enable deviations on either declarations or definitions.
A7-1-1
-DeclarationUnmodifiedObjectMissingConstSpecifier.ql
:- Exclude rvalue references.
EssentialType
- for all queries related to essential types:- Complex floating types are now considered a different essential type than real floating types.
RULE-10-1
RULE-10-3
,RULE-10-4
,RULE-10-5
,RULE-10-7
,RULE-10-8
-OperandsOfAnInappropriateEssentialType.ql
,AssignmentOfIncompatibleEssentialType.ql
,OperandsWithMismatchedEssentialTypeCategory.ql
,InappropriateEssentialTypeCast.ql
,ImplicitConversionOfCompositeExpression.ql
,InappropriateCastOfCompositeExpression.ql
:- Updates to rules handling complex floating types in MISRA-C 2012 Amendment 3 have been implemented.
RULE-14-1
,LoopOverEssentiallyFloatType.ql
:- Query updated to account for the existence of complex essentially floating point types. No change in query results or performance expected.
DIR-4-6
-PlainNumericalTypeUsedOverExplicitTypedef.ql
:- Updates from MISRA-C 2012 Amendment 3 specifying complex fixed width typedef support has been implemented.
RULE-1-4
-EmergentLanguageFeaturesUsed.ql
:- Remove restrictions on
stdnoreturn.h
,stdalign.h
.
- Remove restrictions on
RULE-13-6
-SizeofOperandWithSideEffect.ql
:- Changed from Mandatory to Required in implementation of Technical Corrigenda 2.
RULE-17-5
-ArrayFunctionArgumentNumberOfElements.ql
:- Changed from Advisory to Required in implementation of Technical Corrigenda 2.
RULE-21-11
-StandardHeaderFileTgmathhUsed.ql
:- Changed from Required to Advisory in implementation of Amendment 3.
A3-1-5
-NonTrivialNonTemplateFunctionDefinedInsideClassDefinition.ql
:- Mark this as an
audit
query. As a consequence, it will no longer be run as part of the default query suite for AUTOSAR. It can still be run as part of theautosar-audit.qls
query suite. The query has been downgraded because the rule allows for functions to be declared in the class body if they were "intended" to be inlined, and that developer intention cannot be determined automatically from the code.
- Mark this as an
M5-3-1
-EachOperandOfTheOperatorOfTheLogicalAndOrTheLogicalOperatorsShallHaveTypeBool.ql
:- Consistently exclude results in unevaluated contexts associated with uninstantiated templates, for example
noexcept
specifiers andstatic_assert
s.
- Consistently exclude results in unevaluated contexts associated with uninstantiated templates, for example
A5-1-9
-IdenticalLambdaExpressions.ql
:- Performance has been improved.
- False positives due to repeated invocation of macros containing lambdas have been excluded.
A2-7-3
-UndocumentedUserDefinedType.ql
- Fixes #718. Include trailing characters after group comment endings with ///@{ ... ///@}.
A27-0-3
,FIO309-C
,FIO50-CPP
,RULE-30-0-2
-InterleavedInputOutputWithoutFlush.ql
,DoNotAlternatelyIOFromStreamWithoutPositioning.ql
,InterleavedInputOutputWithoutPosition.ql
,ReadsAndWritesOnStreamNotSeparatedByPositioning.ql
:- Reduce evaluation time on complex codebases.
RULE-22-16
,ERR57-CPP
,A15-1-4
-MutexObjectsNotAlwaysUnlocked.ql
,DoNotLeakResourcesWhenHandlingExceptions.ql
,ValidResourcesStateBeforeThrow.ql
:- Shared module
ResourceLeakAnalysis.qll
changed to not get aliases recursively for simplicity and improved performance. The recent update to these queries had logic intending to handle the case where an allocation node is an alias of a parent node, and the free operation releases that parent node. However, the behavior was incorrectly defined and not working, and in the presence of performance issues this behavior has been removed. - (
RULE-22-16
only) The alias behavior has been updated to compare expressions withHashCons
instead ofGlobalValueNumbering
for higher performance. GVN is more expensive generally, seemed to introduce low performance joins secondarily, and is stricter thanHashCons
in a contravening position, meaning a stricter analysis introduces a higher likelihood of false positives.
- Shared module
Supported versions
- The LGTM pack is not supported on any released version of LGTM without support from GitHub Professional Services.
- The Code Scanning pack is supported when:
- Using the CodeQL CLI version
2.19.4
in conjunction with a copy of the CodeQL standard library for C++ (github/codeql
) set to the tagcodeql-cli/v2.19.4
. - Using the CodeQL Action or CodeQL runner with the codeql-bundle-v2.19.4.
- Using the CodeQL CLI version
Appendix: MISRA-C-2012 new queries
New queries added to cover the following rules:
- DIR-5-2 -
NotNoDeadlocksBetweenThreads.ql
- DIR-5-3 -
ThreadCreatedByThread.ql
,BannedDynamicThreadCreation.ql
- RULE-9-7 -
UninitializedAtomicObject.ql
- RULE-12-6 -
AtomicAggregateObjectDirectlyAccessed.ql
- RULE-21-25 -
InvalidMemoryOrderArgument.ql
- RULE-21-26 -
TimedlockOnInappropriateMutexType.ql
- RULE-22-11 -
ThreadPreviouslyJoinedOrDetached.ql
- RULE-22-12 -
NonstandardUseOfThreadingObject.ql
- RULE-22-13 -
ThreadingObjectWithInvalidStorageDuration.ql
- RULE-22-14 -
MutexNotInitializedBeforeUse.ql
,MutexInitializedInsideThread.ql
,MutexInitWithInvalidMutexType.ql
- RULE-22-16 -
MutexObjectsNotAlwaysUnlocked.ql