It is an experimental (alpha) checker, so the analyzer does not run it by default. It applies to C, C++, Objective-C.
- Code
alpha.clone.CloneChecker
It is an experimental (alpha) checker, so the analyzer does not run it by default. It applies to C, C++.
- Code
alpha.core.CastToStruct
It is an experimental (alpha) checker, so the analyzer does not run it by default. It applies to C, C++, Objective-C.
- Code
alpha.core.Conversion
Such a pointer is dangling. The checker reports it when it is dereferenced and when it is passed to a function. It is an experimental (alpha) checker, so the analyzer does not run it by default. It applies to C, C++.
- Code
alpha.core.DanglingPtrDeref
It is an experimental (alpha) checker, so the analyzer does not run it by default. It applies to C.
- Code
alpha.core.PointerArithm
This implements part of SEI CERT Rule ENV30-C. It is an experimental (alpha) checker, so the analyzer does not run it by default. It applies to C, C++.
- Code
alpha.core.StoreToImmutable
Either the comparison is useless or there is division by zero. It is an experimental (alpha) checker, so the analyzer does not run it by default. It applies to C.
- Code
alpha.core.TestAfterDivZero
The checker only analyzes code that is annotated with the [[clang::lifetimebound]] attribute. The annotation tells the checker which object the returned value is bound to. It is an experimental (alpha) checker, so the analyzer does not run it by default. It applies to C, C++.
- Code
alpha.core.UseAfterLifetimeEnd
It is an experimental (alpha) checker, so the analyzer does not run it by default. It applies to C, C++.
- Code
alpha.deadcode.UnreachableCode
It is an experimental (alpha) checker, so the analyzer does not run it by default. It applies to C.
- Code
alpha.security.ReturnPtrRange
Applies to: memcpy, mempcpy, wmemcpy, wmempcpy. It is an experimental (alpha) checker, so the analyzer does not run it by default. It applies to C.
- Code
alpha.unix.cstring.BufferOverlap
It is an experimental (alpha) checker, so the analyzer does not run it by default. It applies to C.
- Code
alpha.unix.cstring.OutOfBounds
Applies to: pthread_mutex_lock, pthread_rwlock_rdlock, pthread_rwlock_wrlock, lck_mtx_lock, lck_rw_lock_exclusive lck_rw_lock_shared, pthread_mutex_trylock, pthread_rwlock_tryrdlock, pthread_rwlock_tryrwlock, lck_mtx_try_lock, lck_rw_try_lock_exclusive, lck_rw_try_lock_shared, pthread_mutex_unlock, pthread_rwlock_unlock, lck_mtx_unlock, lck_rw_done. It is an experimental (alpha) checker, so the analyzer does not run it by default. It applies to C.
- Code
alpha.unix.PthreadLock
clang-tidy runs it as the check clang-analyzer-core.BitwiseShift. It applies to C, C++.
- Code
core.BitwiseShift
clang-tidy runs it as the check clang-analyzer-core.CallAndMessage. It applies to C, C++, Objective-C.
- Code
core.CallAndMessage
clang-tidy runs it as the check clang-analyzer-core.DivideZero. It applies to C, C++, Objective-C.
- Code
core.DivideZero
clang-tidy runs it as the check clang-analyzer-core.NonNullParamChecker. It applies to C, C++, Objective-C.
- Code
core.NonNullParamChecker
clang-tidy runs it as the check clang-analyzer-core.NullDereference. It applies to C, C++, Objective-C.
- Code
core.NullDereference
clang-tidy runs it as the check clang-analyzer-core.NullPointerArithm. It applies to C, C++.
- Code
core.NullPointerArithm
clang-tidy runs it as the check clang-analyzer-core.StackAddressEscape. It applies to C.
- Code
core.StackAddressEscape
clang-tidy runs it as the check clang-analyzer-core.UndefinedBinaryOperatorResult. It applies to C.
- Code
core.UndefinedBinaryOperatorResult
clang-tidy runs it as the check clang-analyzer-core.uninitialized.ArraySubscript. It applies to C.
- Code
core.uninitialized.ArraySubscript
clang-tidy runs it as the check clang-analyzer-core.uninitialized.Assign. It applies to C.
- Code
core.uninitialized.Assign
clang-tidy runs it as the check clang-analyzer-core.uninitialized.Branch. It applies to C.
- Code
core.uninitialized.Branch
clang-tidy runs it as the check clang-analyzer-core.uninitialized.CapturedBlockVariable. It applies to C.
- Code
core.uninitialized.CapturedBlockVariable
clang-tidy runs it as the check clang-analyzer-core.uninitialized.UndefReturn. It applies to C.
- Code
core.uninitialized.UndefReturn
clang-tidy runs it as the check clang-analyzer-core.VLASize. It applies to C.
- Code
core.VLASize
clang-tidy runs it as the check clang-analyzer-deadcode.DeadStores. It applies to C.
- Code
deadcode.DeadStores
clang-tidy runs it as the check clang-analyzer-nullability.NullReturnedFromNonnull. It applies to C, C++, Objective-C.
- Code
nullability.NullReturnedFromNonnull
This is not necessarily undefined behavior, but can lead to nasty surprises, so projects may decide to use a coding standard that disallows these "unusual" conversions. It is an opt-in checker, so the analyzer runs it only when you enable it. clang-tidy runs it as the check clang-analyzer-optin.core.EnumCastOutOfRange. It applies to C, C++.
- Code
optin.core.EnumCastOutOfRange
It is an opt-in checker, so the analyzer runs it only when you enable it. clang-tidy runs it as the check clang-analyzer-optin.core.FixedAddressDereference. It applies to C, C++, Objective-C.
- Code
optin.core.FixedAddressDereference
It is possible to use such functions safely (as long as they always receive at least one variadic argument), but their careless use can lead to undefined behavior (trying to access a variadic argument when there isn't any), so it is better to avoid them. It is an opt-in checker, so the analyzer runs it only when you enable it. clang-tidy runs it as the check clang-analyzer-optin.core.UnconditionalVAArg. It applies to C, C++.
- Code
optin.core.UnconditionalVAArg
It is an opt-in checker, so the analyzer runs it only when you enable it. clang-tidy runs it as the check clang-analyzer-optin.performance.Padding. It applies to C, C++, Objective-C.
- Code
optin.performance.Padding
It is an opt-in checker, so the analyzer runs it only when you enable it. clang-tidy runs it as the check clang-analyzer-optin.taint.GenericTaint. It applies to C, C++.
- Code
optin.taint.GenericTaint
If an attacker can inject a large value as the size parameter, memory exhaustion denial of service attack can be carried out. It is an opt-in checker, so the analyzer runs it only when you enable it. clang-tidy runs it as the check clang-analyzer-optin.taint.TaintedAlloc. It applies to C, C++.
- Code
optin.taint.TaintedAlloc
If the attacker can set the denominator to 0, a runtime error can be triggered. The checker warns when the denominator is a tainted value and the analyzer cannot prove that it is not 0. It is an opt-in checker, so the analyzer runs it only when you enable it. clang-tidy runs it as the check clang-analyzer-optin.taint.TaintedDiv. It applies to C, C++, Objective-C.
- Code
optin.taint.TaintedDiv
clang-tidy runs it as the check clang-analyzer-osx.API. It applies to C.
- Code
osx.API
clang-tidy runs it as the check clang-analyzer-osx.coreFoundation.CFError. It applies to C.
- Code
osx.coreFoundation.CFError
clang-tidy runs it as the check clang-analyzer-osx.coreFoundation.CFNumber. It applies to C.
- Code
osx.coreFoundation.CFNumber
clang-tidy runs it as the check clang-analyzer-osx.coreFoundation.CFRetainRelease. It applies to C.
- Code
osx.coreFoundation.CFRetainRelease
clang-tidy runs it as the check clang-analyzer-osx.coreFoundation.containers.OutOfBounds. It applies to C.
- Code
osx.coreFoundation.containers.OutOfBounds
clang-tidy runs it as the check clang-analyzer-osx.coreFoundation.containers.PointerSizedValues. It applies to C.
- Code
osx.coreFoundation.containers.PointerSizedValues
clang-tidy runs it as the check clang-analyzer-osx.NumberObjectConversion. It applies to C, C++, Objective-C.
- Code
osx.NumberObjectConversion
clang-tidy runs it as the check clang-analyzer-osx.SecKeychainAPI. It applies to C.
- Code
osx.SecKeychainAPI
This usually means incorrect indexing, but the checker also detects access via the operators * and ->. clang-tidy runs it as the check clang-analyzer-security.ArrayBound. It applies to C, C++.
- Code
security.ArrayBound
clang-tidy runs it as the check clang-analyzer-security.FloatLoopCounter. It applies to C.
- Code
security.FloatLoopCounter
clang-tidy runs it as the check clang-analyzer-security.insecureAPI.bcmp. It applies to C.
- Code
security.insecureAPI.bcmp
clang-tidy runs it as the check clang-analyzer-security.insecureAPI.bcopy. It applies to C.
- Code
security.insecureAPI.bcopy
clang-tidy runs it as the check clang-analyzer-security.insecureAPI.bzero. It applies to C.
- Code
security.insecureAPI.bzero
clang-tidy runs it as the check clang-analyzer-security.insecureAPI.decodeValueOfObjCType. It applies to C.
- Code
security.insecureAPI.decodeValueOfObjCType
clang-tidy runs it as the check clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling. It applies to C.
- Code
security.insecureAPI.DeprecatedOrUnsafeBufferHandling
clang-tidy runs it as the check clang-analyzer-security.insecureAPI.getpw. It applies to C.
- Code
security.insecureAPI.getpw
clang-tidy runs it as the check clang-analyzer-security.insecureAPI.gets. It applies to C.
- Code
security.insecureAPI.gets
clang-tidy runs it as the check clang-analyzer-security.insecureAPI.mkstemp. It applies to C.
- Code
security.insecureAPI.mkstemp
clang-tidy runs it as the check clang-analyzer-security.insecureAPI.mktemp. It applies to C.
- Code
security.insecureAPI.mktemp
clang-tidy runs it as the check clang-analyzer-security.insecureAPI.rand. It applies to C.
- Code
security.insecureAPI.rand
clang-tidy runs it as the check clang-analyzer-security.insecureAPI.strcpy. It applies to C.
- Code
security.insecureAPI.strcpy
clang-tidy runs it as the check clang-analyzer-security.insecureAPI.UncheckedReturn. It applies to C.
- Code
security.insecureAPI.UncheckedReturn
clang-tidy runs it as the check clang-analyzer-security.insecureAPI.vfork. It applies to C.
- Code
security.insecureAPI.vfork
clang-tidy runs it as the check clang-analyzer-security.MmapWriteExec. It applies to C.
- Code
security.MmapWriteExec
According to the C standard §6.5.6 only subtraction of pointers that point into (or one past the end) the same array object is valid (for this purpose non-array variables are like arrays of size 1). This checker only searches for different memory objects at subtraction, but does not check if the array index is correct. clang-tidy runs it as the check clang-analyzer-security.PointerSub. It applies to C.
- Code
security.PointerSub
Function putenv does not copy the passed string, only a pointer to the data is stored and this data can be read even by other threads. Content of a stack-allocated array is likely to be overwritten after exiting from the function. clang-tidy runs it as the check clang-analyzer-security.PutenvStackArray. It applies to C.
- Code
security.PutenvStackArray
Function setgid will likely fail if the superuser privileges are already dropped. clang-tidy runs it as the check clang-analyzer-security.SetgidSetuidOrder. It applies to C.
- Code
security.SetgidSetuidOrder
clang-tidy runs it as the check clang-analyzer-security.VAList. It applies to C, C++.
- Code
security.VAList
clang-tidy runs it as the check clang-analyzer-unix.API. It applies to C.
- Code
unix.API
Blocking functions detected by this checker: sleep, getc, fgets, read, recv. Critical section handling functions modeled by this checker: lock, unlock, pthread_mutex_lock, pthread_mutex_trylock, pthread_mutex_unlock, mtx_lock, mtx_timedlock, mtx_trylock, mtx_unlock, lock_guard, unique_lock, scoped_lock. clang-tidy runs it as the check clang-analyzer-unix.BlockInCriticalSection. It applies to C, C++.
- Code
unix.BlockInCriticalSection
The checker finds usage patterns where chdir("/") is not called immediately after a call to chroot(path). clang-tidy runs it as the check clang-analyzer-unix.Chroot. It applies to C.
- Code
unix.Chroot
Use -Wno-strncat-size compiler option to mute other strncat-related compiler warnings. clang-tidy runs it as the check clang-analyzer-unix.cstring.BadSizeArg. It applies to C.
- Code
unix.cstring.BadSizeArg
clang-tidy runs it as the check clang-analyzer-unix.cstring.NotNullTerminated. It applies to C.
- Code
unix.cstring.NotNullTerminated
clang-tidy runs it as the check clang-analyzer-unix.cstring.NullArg. It applies to C.
- Code
unix.cstring.NullArg
clang-tidy runs it as the check clang-analyzer-unix.cstring.UninitializedRead. It applies to C.
- Code
unix.cstring.UninitializedRead
This checker implements partially CERT rule ERR30-C. Set errno to zero before calling a library function known to set errno, and check errno only after the function returns a value indicating failure. The checker can find the first read of errno after successful standard function calls. clang-tidy runs it as the check clang-analyzer-unix.Errno. It applies to C.
- Code
unix.Errno
Traces memory managed by malloc()/free(). clang-tidy runs it as the check clang-analyzer-unix.Malloc. It applies to C.
- Code
unix.Malloc
clang-tidy runs it as the check clang-analyzer-unix.MallocSizeof. It applies to C.
- Code
unix.MallocSizeof
clang-tidy runs it as the check clang-analyzer-unix.MismatchedDeallocator. It applies to C, C++.
- Code
unix.MismatchedDeallocator
For example, according to the C standard the behavior of function int isalnum(int ch) is undefined if the value of ch is not representable as unsigned char and is not equal to EOF. clang-tidy runs it as the check clang-analyzer-unix.StdCLibraryFunctions. It applies to C.
- Code
unix.StdCLibraryFunctions
clang-tidy runs it as the check clang-analyzer-unix.Stream. It applies to C.
- Code
unix.Stream
clang-tidy runs it as the check clang-analyzer-unix.Vfork. It applies to C.
- Code
unix.Vfork