Clang enables it by default.
- Code
-Wstatic-self-init- Severity
- warning
- Message
static variable {} is suspiciously used within its own initialization
Clang enables it by default.
- Code
-Wstdlibcxx-not-found- Severity
- warning
- Message
include path for libstdc++ headers not found; pass ‘-stdlib=libc++’ on the command line to use the libc++ standard library instead
- Code
-Wstrict-aliasing- Severity
- warning
- Code
-Wstrict-aliasing=0- Severity
- warning
- Code
-Wstrict-aliasing=1- Severity
- warning
- Code
-Wstrict-aliasing=2- Severity
- warning
- Code
-Wstrict-overflow- Severity
- warning
- Code
-Wstrict-overflow=0- Severity
- warning
- Code
-Wstrict-overflow=1- Severity
- warning
- Code
-Wstrict-overflow=2- Severity
- warning
- Code
-Wstrict-overflow=3- Severity
- warning
- Code
-Wstrict-overflow=4- Severity
- warning
- Code
-Wstrict-overflow=5- Severity
- warning
Clang enables some of the diagnostics that it controls by default. It also controls -Wpotentially-direct-selector.
- Code
-Wstrict-potentially-direct-selector- Severity
- warning
- Message
@selector expression formed with potentially direct selector {}
- Code
-Wstrict-primary-template-shadow- Severity
- error
- Message
declaration of {} shadows template parameter
A. -Wstrict-prototypes
Clang enables some of the diagnostics that it controls by default. It also controls -Wdeprecated-non-prototype. Clang has 4 messages for this flag.
- Code
-Wstrict-prototypes- Severity
- warning
- Message
a- Message
function- Message
block- Message
in all versions of C
- Code
-Wstrict-selector-match- Severity
- warning
- Message
multiple methods named {} found
Clang enables it by default. Clang has 3 messages for this flag.
- Code
-Wstring-compare- Severity
- warning
- Message
result of comparison against- Message
a string literal- Message
@encode
- Code
-Wstring-concatenation- Severity
- warning
- Message
suspicious concatenation of string literals in an array initialization; did you mean to separate the elements with a comma?
- Code
-Wstring-conversion- Severity
- warning
- Message
implicit conversion turns string literal into bool: {} to {}
Clang enables it by default.
- Code
-Wstring-plus-char- Severity
- warning
- Message
adding {} to a string pointer does not append to the string
Clang enables it by default.
- Code
-Wstring-plus-int- Severity
- warning
- Message
adding {} to a string does not append to the string
Clang enables it by default. Clang has 2 messages for this flag.
- Code
-Wstringop-overread- Severity
- warning
- Message
‘{}’ reading {} byte- Message
s
Clang enables it by default.
- Code
-Wstrlcpy-strlcat-size- Severity
- warning
- Message
size argument in {} call appears to be size of the source; expected the size of the destination
Clang enables it by default. Clang has 3 messages for this flag.
- Code
-Wstrncat-size- Severity
- warning
- Message
the value of the size argument in ‘strncat’ is too large, might lead to a buffer overflow- Message
size argument in ‘strncat’ call appears to be size of the source- Message
the value of the size argument to ‘strncat’ is wrong
- Code
-Wsuggest-destructor-override- Severity
- warning
- Message
{} overrides a destructor but is not marked ‘override’
- Code
-Wsuggest-override- Severity
- warning
- Message
{} overrides a member function but is not marked ‘override’
Clang has 3 messages for this flag.
- Code
-Wsuper-class-method-mismatch- Severity
- warning
- Message
method parameter type- Message
{} does not match super class method parameter type {}- Message
does not match super class method parameter type
Clang enables it by default.
- Code
-Wsuspicious-bzero- Severity
- warning
- Message
‘size’ argument to bzero is ‘0’
Clang enables it by default. It also controls -Wdynamic-class-memaccess, -Wmemset-transposed-args, -Wnontrivial-memaccess, -Wsizeof-pointer-memaccess, -Wsuspicious-bzero.
- Code
-Wsuspicious-memaccess- Severity
- warning
Clang enables it by default. Clang has 23 messages for this flag.
- Code
-Wswift-name-attribute- Severity
- warning
- Message
{} attribute cannot be applied to this declaration- Message
{} attribute cannot be applied to a- Message
function- Message
method- Message
{} attribute argument must be a string literal specifying a Swift function name- Message
{} attribute for getter must not have any parameters besides ‘self:’- Message
{} attribute has invalid identifier for the- Message
base
Clang enables it by default. Clang has 6 messages for this flag.
- Code
-Wswitch- Severity
- warning
- Message
overflow converting case value to switch condition type ({} to {})- Message
enumeration value {} not handled in switch- Message
enumeration values {} and {} not handled in switch- Message
enumeration values {}, {}, and {} not handled in switch- Message
{} enumeration values not handled in switch: {}, {}, {}…- Message
case value not in enumerated type {}
Clang enables it by default.
- Code
-Wswitch-bool- Severity
- warning
- Message
switch condition has boolean value
- Code
-Wswitch-default- Severity
- warning
- Message
‘switch’ missing ‘default’ label
Clang has 4 messages for this flag.
- Code
-Wswitch-enum- Severity
- warning
- Message
enumeration value {} not explicitly handled in switch- Message
enumeration values {} and {} not explicitly handled in switch- Message
enumeration values {}, {}, and {} not explicitly handled in switch- Message
{} enumeration values not explicitly handled in switch: {}, {}, {}…
Clang enables it by default.
- Code
-Wsync-alignment- Severity
- warning
- Message
__sync builtin operation must have natural alignment (consider using __atomic)
Clang enables it by default.
- Code
-Wsync-fetch-and-nand-semantics-changed- Severity
- warning
- Message
the semantics of this intrinsic changed with GCC version 4.4 - the newer semantics are provided here
- Code
-Wsynth- Severity
- warning
Clang enables it by default.
- Code
-Wtarget-clones-mixed-specifiers- Severity
- warning
- Message
mixing ‘target_clones’ specifier mechanisms is permitted for GCC compatibility; use a comma separated sequence of string literals, or a string literal containing a comma-separated list of versions
Clang has 4 messages for this flag.
- Code
-Wtautological-bitwise-compare- Severity
- warning
- Message
bitwise comparison always evaluates to- Message
false- Message
true- Message
bitwise or with non-zero value always evaluates to true
Clang enables some of the diagnostics that it controls by default. It also controls -Wtautological-bitwise-compare, -Wtautological-constant-compare, -Wtautological-negation-compare, -Wtautological-objc-bool-compare, -Wtautological-overlap-compare, -Wtautological-pointer-compare, -Wtautological-undefined-compare. Clang has 11 messages for this flag.
- Code
-Wtautological-compare- Severity
- warning
- Message
aligning a value- Message
the result of checking whether a value is aligned- Message
a no-op- Message
always true- Message
self-- Message
array- Message
pointer- Message
a constant
Clang enables it by default. It also controls -Wtautological-constant-out-of-range-compare. Clang has 10 messages for this flag.
- Code
-Wtautological-constant-compare- Severity
- warning
- Message
converting the result of ‘?:’ with integer constants to a boolean always evaluates to ‘true’- Message
converting the result of ‘<<’ to a boolean always evaluates to- Message
false- Message
true- Message
result of comparison of- Message
constant {}- Message
true- Message
false
A group of warnings. -Wtautological-constant-in-range-compare
It also controls -Wtautological-value-range-compare, -Wtype-limits.
- Code
-Wtautological-constant-in-range-compare- Severity
- warning
Clang enables it by default. Clang has 6 messages for this flag.
- Code
-Wtautological-constant-out-of-range-compare- Severity
- warning
- Message
result of comparison of- Message
constant {}- Message
true- Message
false- Message
expression of type {}- Message
boolean expression
Clang has 2 messages for this flag.
- Code
-Wtautological-negation-compare- Severity
- warning
- Message
‘&&’ of a value and its negation always evaluates to false- Message
‘||’ of a value and its negation always evaluates to true
Clang enables it by default.
- Code
-Wtautological-objc-bool-compare- Severity
- warning
- Message
result of comparison of constant {} with expression of type ‘BOOL’ is always {}, as the only well defined values for ‘BOOL’ are YES and NO
Non-. -Wtautological-overlap-compare
Clang has 3 messages for this flag.
- Code
-Wtautological-overlap-compare- Severity
- warning
- Message
non-- Message
false- Message
true
Clang enables it by default. Clang has 13 messages for this flag.
- Code
-Wtautological-pointer-compare- Severity
- warning
- Message
comparison of nonnull- Message
function call- Message
parameter- Message
not- Message
true- Message
false- Message
comparison of- Message
address of
Clang has 5 messages for this flag.
- Code
-Wtautological-type-limit-compare- Severity
- warning
- Message
result of comparison- Message
{}- Message
{}- Message
{}- Message
{}
Clang enables it by default. Clang has 6 messages for this flag.
- Code
-Wtautological-undefined-compare- Severity
- warning
- Message
reference cannot be bound to dereferenced null pointer in well-defined C++ code; comparison may be assumed to always evaluate to- Message
true- Message
false- Message
‘this’ pointer cannot be null in well-defined C++ code; comparison may be assumed to always evaluate to- Message
true- Message
false
Clang has 5 messages for this flag.
- Code
-Wtautological-unsigned-char-zero-compare- Severity
- warning
- Message
result of comparison of- Message
{}- Message
char expression- Message
char expression- Message
{}
Clang has 5 messages for this flag.
- Code
-Wtautological-unsigned-enum-zero-compare- Severity
- warning
- Message
result of comparison of- Message
{}- Message
unsigned enum expression- Message
unsigned enum expression- Message
{}
Clang has 5 messages for this flag.
- Code
-Wtautological-unsigned-zero-compare- Severity
- warning
- Message
result of comparison of- Message
{}- Message
unsigned expression- Message
unsigned expression- Message
{}
Clang has 9 messages for this flag.
- Code
-Wtautological-value-range-compare- Severity
- warning
- Message
result of comparison of- Message
{}- Message
{}-bit- Message
signed- Message
unsigned- Message
{}-bit- Message
signed- Message
unsigned
Clang enables it by default.
- Code
-Wtcb-enforcement- Severity
- warning
- Message
calling {} is a violation of trusted computing base ‘{}’
Clang enables it by default.
- Code
-Wtemplate-in-declaration-name- Severity
- warning
- Message
‘template’ cannot be used after a declarative nested name specifier
Clang enables it by default.
- Code
-Wtentative-definition-array- Severity
- warning
- Message
tentative array definition assumed to have one element
- Code
-Wtentative-definition-compat- Severity
- warning
- Message
duplicate declaration of {} is invalid in C++
Clang has 3 messages for this flag.
- Code
-Wtentative-definition-incomplete-type- Severity
- warning
- Message
tentative definition of variable with internal linkage has incomplete- Message
non-array- Message
array
It also controls -Wthread-safety-analysis, -Wthread-safety-attributes, -Wthread-safety-precise, -Wthread-safety-reference.
- Code
-Wthread-safety- Severity
- warning
Clang has 44 messages for this flag.
- Code
-Wthread-safety-analysis- Severity
- warning
- Message
{} ‘{}’ must be acquired before ‘{}’- Message
cycle in acquired_before/after dependencies, starting with ‘{}’- Message
cannot resolve lock expression- Message
acquiring {} ‘{}’ that is already held- Message
did not expect {} ‘{}’ to be managed by ‘{}’- Message
{} ‘{}’ not managed by ‘{}’- Message
expecting {} ‘{}’ to be held at start of each loop- Message
with equal reentrancy depth
Clang has 13 messages for this flag.
- Code
-Wthread-safety-attributes- Severity
- warning
- Message
{} attribute requires arguments whose type is annotated with ‘capability’ attribute; type here is {}- Message
{} attribute can only be applied in a context annotated with ‘capability’ attribute- Message
{} only applies to pointer types; type here is {}- Message
ignoring {} attribute because its argument is invalid- Message
{} attribute without capability arguments refers to ‘this’, but {} isn’t annotated with ‘capability’ or ‘scoped_lockable’ attribute- Message
{} attribute on a- Message
variable- Message
field
- Code
-Wthread-safety-beta- Severity
- warning
- Message
thread safety beta warning
- Code
-Wthread-safety-negative- Severity
- warning
- Message
acquiring {} ‘{}’ requires negative capability ‘{}’
Clang has 12 messages for this flag.
- Code
-Wthread-safety-pointer- Severity
- warning
- Message
passing pointer to variable {} requires holding {}- Message
‘{}’- Message
‘{}’ exclusively- Message
returning pointer to variable {} requires holding {}- Message
‘{}’- Message
‘{}’ exclusively- Message
passing pointer {} requires holding {}- Message
‘{}’
Clang has 11 messages for this flag.
- Code
-Wthread-safety-precise- Severity
- warning
- Message
calling function {} requires holding {}- Message
‘{}’- Message
‘{}’ exclusively- Message
reading- Message
writing- Message
‘{}’- Message
‘{}’ exclusively- Message
reading
It also controls -Wthread-safety-reference-return. Clang has 6 messages for this flag.
- Code
-Wthread-safety-reference- Severity
- warning
- Message
passing variable {} by reference requires holding {}- Message
‘{}’- Message
‘{}’ exclusively- Message
passing the value that {} points to by reference requires holding {}- Message
‘{}’- Message
‘{}’ exclusively
Clang has 6 messages for this flag.
- Code
-Wthread-safety-reference-return- Severity
- warning
- Message
returning variable {} by reference requires holding {}- Message
‘{}’- Message
‘{}’ exclusively- Message
returning the value that {} points to by reference requires holding {}- Message
‘{}’- Message
‘{}’ exclusively
- Code
-Wthread-safety-verbose- Severity
- warning
- Message
thread safety verbose warning
Clang enables it by default. Clang has 4 messages for this flag.
- Code
-Wtrigraphs- Severity
- warning
- Message
trigraph converted to ‘{}’ character- Message
trigraph ends block comment- Message
trigraph ignored- Message
ignored trigraph would end block comment
Clang enables it by default.
- Code
-Wtrivial-auto-var-init- Severity
- warning
- Message
-ftrivial-auto-var-init-stop-after={} has been enabled to limit the number of times ftrivial-auto-var-init={} gets applied
Clang enables it by default.
- Code
-WTU-local-entity-exposure- Severity
- warning
- Message
TU local entity {} is exposed
It also controls -Wtautological-type-limit-compare, -Wtautological-unsigned-char-zero-compare, -Wtautological-unsigned-enum-zero-compare, -Wtautological-unsigned-zero-compare.
- Code
-Wtype-limits- Severity
- warning
Clang enables it by default. Clang has 4 messages for this flag.
- Code
-Wtype-safety- Severity
- warning
- Message
specified {} type tag requires a null pointer- Message
argument type {} doesn’t match specified {} type tag- Message
that requires {}- Message
this type tag was not designed to be used with this function
Clang enables it by default.
- Code
-Wtypedef-redefinition- Severity
- warning
- Message
redefinition of typedef {} is a C11 feature
Clang enables it by default.
- Code
-Wtypename-missing- Severity
- warning
- Message
missing ‘typename’ prior to dependent type name {}
Clang enables it by default.
- Code
-Wunable-to-open-stats-file- Severity
- warning
- Message
unable to open statistics output file ‘{}’: ‘{}’
- Code
-Wunaligned-access- Severity
- warning
- Message
field {} within {} is less aligned than {} and is usually due to {} being packed, which can lead to unaligned accesses
Clang enables it by default.
- Code
-Wunaligned-qualifier-implicit-cast- Severity
- warning
- Message
implicit cast from type {} to type {} drops __unaligned qualifier
Clang enables it by default.
- Code
-Wunavailable-declarations- Severity
- warning
- Message
{} may be unavailable because the receiver type is unknown
Clang has 2 messages for this flag.
- Code
-Wundeclared-selector- Severity
- warning
- Message
undeclared selector {}- Message
undeclared selector {}; did you mean {}?
Clang enables some of the diagnostics that it controls by default. It also controls -Wundef-true.
- Code
-Wundef- Severity
- warning
- Message
{} is not defined, evaluates to 0
- Code
-Wundef-prefix- Severity
- warning
- Message
{} is not defined, evaluates to 0
Clang enables it by default.
- Code
-Wundef-true- Severity
- warning
- Message
‘true’ is not defined, evaluates to 0
Clang enables it by default. Clang has 2 messages for this flag.
- Code
-Wundefined-bool-conversion- Severity
- warning
- Message
reference cannot be bound to dereferenced null pointer in well-defined C++ code; pointer may be assumed to always convert to true- Message
‘this’ pointer cannot be null in well-defined C++ code; pointer may be assumed to always convert to true
- Code
-Wundefined-func-template- Severity
- warning
- Message
instantiation of function {} required here, but no definition is available
Clang enables it by default.
- Code
-Wundefined-inline- Severity
- warning
- Message
inline function {} is not defined
Function. -Wundefined-internal
Clang enables it by default. Clang has 2 messages for this flag.
- Code
-Wundefined-internal- Severity
- warning
- Message
function- Message
variable
Clang has 3 messages for this flag.
- Code
-Wundefined-internal-type- Severity
- warning
- Message
ISO C++ requires a definition in this translation unit for- Message
function- Message
variable
Clang has 2 messages for this flag.
- Code
-Wundefined-reinterpret-cast- Severity
- warning
- Message
dereference of type {} that was reinterpret_cast from type {} has undefined behavior- Message
reinterpret_cast from {} to {} has undefined behavior
Clang enables it by default.
- Code
-Wundefined-var-template- Severity
- warning
- Message
instantiation of variable {} required here, but no definition is available
Clang enables it by default.
- Code
-Wunderaligned-exception-object- Severity
- warning
- Message
underaligned exception object thrown
- Code
-Wunderlying-atomic-qualifier-ignored- Severity
- error
- Message
‘_Atomic’ qualifier ignored; operations involving the enumeration type will be non-atomic
Clang enables it by default. Clang has 3 messages for this flag.
- Code
-Wunderlying-cv-qualifier-ignored- Severity
- warning
- Message
‘const’ and ‘volatile’ qualifiers- Message
‘const’ qualifier- Message
‘volatile’ qualifier
Clang enables it by default. It also controls -Wpotentially-evaluated-expression.
- Code
-Wunevaluated-expression- Severity
- warning
- Message
expression with side effects has no effect in an unevaluated context
Clang enables some of the diagnostics that it controls by default. It also controls -Wunguarded-availability-new. Clang has 3 messages for this flag.
- Code
-Wunguarded-availability- Severity
- warning
- Message
{} is only available- Message
in {} environment- Message
{} is unavailable
Clang enables it by default. Clang has 3 messages for this flag.
- Code
-Wunguarded-availability-new- Severity
- warning
- Message
{} is only available- Message
in {} environment- Message
{} is unavailable
Clang enables it by default. Clang has 7 messages for this flag.
- Code
-Wunicode- Severity
- warning
- Message
empty delimited universal character name; treating as ‘\’ ‘{}’ ‘{’ ‘}’- Message
incomplete delimited universal character name; treating as ‘\’ ‘{}’ ‘{’ identifier- Message
incomplete universal character name; treating as ‘\’ followed by identifier- Message
\{} used with no following hex digits; treating as ‘\’ followed by identifier- Message
universal character name refers to a surrogate character- Message
universal character names are only valid in C99 or C++; treating as ‘\’ followed by identifier- Message
universal character names are only valid in C99 or C++
Clang enables it by default.
- Code
-Wunicode-homoglyph- Severity
- warning
- Message
treating character {} as an identifier character rather than as ‘{}’ symbol
- Code
-Wunicode-whitespace- Severity
- error
- Message
treating character {} as whitespace
Clang enables it by default.
- Code
-Wunicode-zero-width- Severity
- warning
- Message
identifier contains character {} that is invisible in some environments
Clang enables some of the diagnostics that it controls by default. It also controls -Wsometimes-uninitialized, -Wstatic-self-init, -Wuninitialized-const-pointer, -Wuninitialized-const-reference. Clang has 16 messages for this flag.
- Code
-Wuninitialized- Severity
- warning
- Message
base class {} is uninitialized when used here to access {}- Message
field {} is uninitialized when used here- Message
struct- Message
interface- Message
union- Message
class- Message
enum- Message
reference {} is not yet bound to a value when used here
- Code
-Wuninitialized-const-pointer- Severity
- warning
- Message
variable {} is uninitialized when passed as a const pointer argument here
- Code
-Wuninitialized-const-reference- Severity
- warning
- Message
variable {} is uninitialized when passed as a const reference argument here
Field. -Wuninitialized-explicit-init
Clang enables it by default. Clang has 3 messages for this flag.
- Code
-Wuninitialized-explicit-init- Severity
- warning
- Message
field- Message
{}- Message
in {}
Clang has 6 messages for this flag.
- Code
-Wunique-object-duplication- Severity
- warning
- Message
initialization of {} may run twice when built into a shared library: it has external linkage and- Message
hidden visibility- Message
no import/export annotation- Message
{} may be duplicated when built into a shared library: it is mutable, with external linkage and- Message
hidden visibility- Message
no import/export annotation
Clang enables it by default.
- Code
-Wunknown-acc-extension-clause- Severity
- warning
- Message
unsupported OpenACC extension clause {}
Clang enables it by default. Clang has 3 messages for this flag.
- Code
-Wunknown-argument- Severity
- warning
- Message
joined argument treated as ‘{}’; did you mean ‘{}’?- Message
unknown argument ignored in clang-cl: ‘{}’- Message
unknown argument ignored in clang-cl ‘{}’; did you mean ‘{}’?
Clang enables it by default.
- Code
-Wunknown-assumption- Severity
- warning
- Message
unknown assumption string ‘{}’; attribute is potentially ignored
Clang enables it by default. Clang has 2 messages for this flag.
- Code
-Wunknown-attributes- Severity
- warning
- Message
unknown attribute {} ignored- Message
unknown attribute {} ignored; did you mean ‘{}’?
Clang enables it by default. Clang has 3 messages for this flag.
- Code
-Wunknown-cuda-version- Severity
- warning
- Message
CUDA version{} is newer than the latest- Message
partially- Message
CUDA version {} is only partially supported
Clang enables it by default. Clang has 2 messages for this flag.
- Code
-Wunknown-directives- Severity
- warning
- Message
invalid preprocessing directive- Message
, did you mean ‘#{}’?
Clang enables it by default.
- Code
-Wunknown-escape-sequence- Severity
- warning
- Message
unknown escape sequence ‘\{}’
Clang enables some of the diagnostics that it controls by default. Clang has 20 messages for this flag.
- Code
-Wunknown-pragmas- Severity
- warning
- Message
expected ‘ON’ or ‘OFF’ or ‘DEFAULT’ in pragma- Message
expected end of directive in pragma- Message
unknown pragma in STDC namespace- Message
pragma diagnostic pop could not pop, no matching push- Message
pragma diagnostic expected ‘error’, ‘warning’, ‘ignored’, ‘fatal’, ‘push’, or ‘pop’- Message
pragma diagnostic expected option name (e.g. “-Wundef”)- Message
unexpected token in pragma diagnostic- Message
#pragma execution_character_set expected ‘{}’
Clang enables it by default.
- Code
-Wunknown-sanitizers- Severity
- warning
- Message
unknown sanitizer ‘{}’ ignored
Clang enables it by default. Clang has 6 messages for this flag.
- Code
-Wunknown-warning-option- Severity
- warning
- Message
unknown warning group ‘{}’, ignored- Message
unknown- Message
warning- Message
remark- Message
; did you mean ‘{}’?- Message
unknown {} warning specifier: ‘{}’
Clang enables some of the diagnostics that it controls by default. It also controls -Wc++98-compat-unnamed-type-template-args.
- Code
-Wunnamed-type-template-args- Severity
- warning
- Message
template argument uses unnamed type
- Code
-Wunnecessary-virtual-specifier- Severity
- warning
- Message
virtual method {} is inside a ‘final’ class and can never be overridden
Function. -Wunneeded-internal-declaration
Clang has 3 messages for this flag.
- Code
-Wunneeded-internal-declaration- Severity
- warning
- Message
function- Message
variable- Message
‘static’ function {} declared in header file should be declared ‘static inline’
- Code
-Wunneeded-member-function- Severity
- warning
- Message
member function {} is not needed and will not be emitted
Clang enables it by default.
- Code
-Wunqualified-std-cast-call- Severity
- warning
- Message
unqualified call to ‘{}’
Clang enables some of the diagnostics that it controls by default. It also controls -Wunreachable-code-fallthrough, -Wunreachable-code-generic-assoc, -Wunreachable-code-loop-increment.
- Code
-Wunreachable-code- Severity
- warning
- Message
code will never be executed
Clang enables some of the diagnostics that it controls by default. It also controls -Wunreachable-code, -Wunreachable-code-break, -Wunreachable-code-return.
- Code
-Wunreachable-code-aggressive- Severity
- warning
- Code
-Wunreachable-code-break- Severity
- warning
- Message
‘break’ will never be executed
- Code
-Wunreachable-code-fallthrough- Severity
- warning
- Message
fallthrough annotation in unreachable code
Clang enables it by default. Clang has 3 messages for this flag.
- Code
-Wunreachable-code-generic-assoc- Severity
- warning
- Message
due to lvalue conversion of the controlling expression, association of type {} will never be selected because it is- Message
of array type- Message
qualified
- Code
-Wunreachable-code-loop-increment- Severity
- warning
- Message
loop will run at most once (loop increment never executed)
- Code
-Wunreachable-code-return- Severity
- warning
- Message
‘return’ will never be executed
It also controls -Wunsafe-buffer-usage-in-container, -Wunsafe-buffer-usage-in-format-attr-call, -Wunsafe-buffer-usage-in-libc-call, -Wunsafe-buffer-usage-in-static-sized-array, -Wunsafe-buffer-usage-in-string-view, -Wunsafe-buffer-usage-in-unique-ptr-array-access, -Wunsafe-buffer-usage-main-argv. Clang has 9 messages for this flag.
- Code
-Wunsafe-buffer-usage- Severity
- warning
- Message
unsafe pointer operation- Message
unsafe pointer arithmetic- Message
unsafe buffer access- Message
function introduces unsafe buffer manipulation- Message
unsafe invocation of {}- Message
field {} prone to unsafe buffer manipulation- Message
{} is an- Message
unsafe pointer used for buffer access
- Code
-Wunsafe-buffer-usage-in-container- Severity
- warning
- Message
the two-parameter {} construction is unsafe as it can introduce mismatch between buffer size and the bound information
- Code
-Wunsafe-buffer-usage-in-format-attr-call- Severity
- warning
- Message
formatting function {} is unsafe
It also controls -Wunsafe-buffer-usage-in-libc-call-io, -Wunsafe-buffer-usage-in-libc-call-memory, -Wunsafe-buffer-usage-in-libc-call-numeric-conversion, -Wunsafe-buffer-usage-in-libc-call-printf, -Wunsafe-buffer-usage-in-libc-call-scanf, -Wunsafe-buffer-usage-in-libc-call-string-examination, -Wunsafe-buffer-usage-in-libc-call-string-manipulation.
- Code
-Wunsafe-buffer-usage-in-libc-call- Severity
- warning
- Message
function {} is unsafe
- Code
-Wunsafe-buffer-usage-in-libc-call-io- Severity
- warning
- Message
function {} is unsafe
- Code
-Wunsafe-buffer-usage-in-libc-call-memory- Severity
- warning
- Message
function {} is unsafe
Function … is unsafe. -Wunsafe-buffer-usage-in-libc-call-numeric-conversion
- Code
-Wunsafe-buffer-usage-in-libc-call-numeric-conversion- Severity
- warning
- Message
function {} is unsafe
- Code
-Wunsafe-buffer-usage-in-libc-call-printf- Severity
- warning
- Message
function {} is unsafe
- Code
-Wunsafe-buffer-usage-in-libc-call-scanf- Severity
- warning
- Message
function {} is unsafe
Function … is unsafe. -Wunsafe-buffer-usage-in-libc-call-string-examination
- Code
-Wunsafe-buffer-usage-in-libc-call-string-examination- Severity
- warning
- Message
function {} is unsafe
Function … is unsafe. -Wunsafe-buffer-usage-in-libc-call-string-manipulation
- Code
-Wunsafe-buffer-usage-in-libc-call-string-manipulation- Severity
- warning
- Message
function {} is unsafe
- Code
-Wunsafe-buffer-usage-in-static-sized-array- Severity
- warning
- Message
direct access on T[N] is unsafe due to the lack of bounds checking
- Code
-Wunsafe-buffer-usage-in-string-view- Severity
- warning
- Message
the two-parameter std::string_view construction is unsafe
- Code
-Wunsafe-buffer-usage-in-unique-ptr-array-access- Severity
- warning
- Message
direct access using operator[] on std::unique_ptr<T[]> is unsafe due to lack of bounds checking
Clang has 9 messages for this flag.
- Code
-Wunsafe-buffer-usage-main-argv- Severity
- warning
- Message
unsafe pointer operation- Message
unsafe pointer arithmetic- Message
unsafe buffer access- Message
function introduces unsafe buffer manipulation- Message
unsafe invocation of {}- Message
field {} prone to unsafe buffer manipulation- Message
{} is an- Message
unsafe pointer used for buffer access
Clang enables it by default. Clang has 2 messages for this flag.
- Code
-Wunsequenced- Severity
- warning
- Message
multiple unsequenced modifications to {}- Message
unsequenced modification and access to {}
Clang enables it by default. Clang has 2 messages for this flag.
- Code
-Wunsupported-abi- Severity
- warning
- Message
‘{}’: selected processor lacks floating point registers- Message
float ABI ‘{}’ is not supported by current library
Clang enables it by default. Clang has 2 messages for this flag.
- Code
-Wunsupported-abs- Severity
- warning
- Message
ignoring ‘-mabs=2008’ option because the ‘{}’ architecture does not support it- Message
ignoring ‘-mabs=legacy’ option because the ‘{}’ architecture does not support it
@available. -Wunsupported-availability-guard
Clang enables it by default. Clang has 4 messages for this flag.
- Code
-Wunsupported-availability-guard- Severity
- warning
- Message
@available- Message
__builtin_available- Message
@available- Message
__builtin_available
Clang enables it by default.
- Code
-Wunsupported-cb- Severity
- warning
- Message
ignoring ‘-mcompact-branches=’ option because the ‘{}’ architecture does not support it
Clang has 3 messages for this flag.
- Code
-Wunsupported-dll-base-class-template- Severity
- warning
- Message
propagating dll attribute to- Message
already instantiated- Message
explicitly specialized
Clang enables it by default. Clang has 2 messages for this flag.
- Code
-Wunsupported-floating-point-opt- Severity
- warning
- Message
overriding currently unsupported use of floating point exceptions on this target- Message
overriding currently unsupported rounding mode on this target
Clang enables it by default. Clang has 2 messages for this flag.
- Code
-Wunsupported-gpopt- Severity
- warning
- Message
ignoring ‘-mgpopt’ option as it cannot be used with- Message
the implicit usage of
Clang enables it by default. Clang has 2 messages for this flag.
- Code
-Wunsupported-nan- Severity
- warning
- Message
ignoring ‘-mnan=2008’ option because the ‘{}’ architecture does not support it- Message
ignoring ‘-mnan=legacy’ option because the ‘{}’ architecture does not support it
Clang enables it by default. Clang has 2 messages for this flag.
- Code
-Wunsupported-target-opt- Severity
- warning
- Message
debug information option ‘{}’ is not supported; requires DWARF-{} but target ‘{}’ only provides DWARF-{}- Message
debug information option ‘{}’ is not supported for target ‘{}’
Clang enables it by default.
- Code
-Wunsupported-visibility- Severity
- warning
- Message
target does not support ‘protected’ visibility; using ‘default’
- Code
-Wunterminated-string-initialization- Severity
- warning
- Message
initializer-string for character array is too long, array size is {} but initializer has size {} (including the null terminating character); did you mean to use the ‘nonstring’ attribute?
Class. -Wunusable-partial-specialization
Clang has 4 messages for this flag.
- Code
-Wunusable-partial-specialization- Severity
- warning
- Message
class- Message
variable- Message
a template parameter- Message
template parameters
Clang enables some of the diagnostics that it controls by default. It also controls -Wunused-argument, -Wunused-but-set-variable, -Wunused-function, -Wunused-label, -Wunused-lambda-capture, -Wunused-local-typedef, -Wunused-private-field, -Wunused-property-ivar, -Wunused-value, -Wunused-variable.
- Code
-Wunused- Severity
- warning
- Code
-Wunused-argument- Severity
- warning
- Code
-Wunused-but-set-global- Severity
- warning
- Message
variable {} set but not used
- Code
-Wunused-but-set-parameter- Severity
- warning
- Message
parameter {} set but not used
It also controls -Wunused-but-set-global.
- Code
-Wunused-but-set-variable- Severity
- warning
- Message
variable {} set but not used
Clang enables it by default. Clang has 19 messages for this flag.
- Code
-Wunused-command-line-argument- Severity
- warning
- Message
argument ‘{}’ requires profile-guided optimization information- Message
argument ‘{}’ requires profile-guided optimization information- Message
joined argument expects additional value: ‘{}’- Message
ignoring ‘-f- Message
no-- Message
{}: ‘{}’ input unused- Message
when ‘{}’ is present- Message
{}: ‘{}’ input unused in cpp mode
Equality. -Wunused-comparison
Clang enables it by default. Clang has 4 messages for this flag.
- Code
-Wunused-comparison- Severity
- warning
- Message
equality- Message
inequality- Message
relational- Message
three-way
- Code
-Wunused-const-variable- Severity
- warning
- Message
unused variable {}
- Code
-Wunused-exception-parameter- Severity
- warning
- Message
unused exception parameter {}
It also controls -Wunneeded-internal-declaration.
- Code
-Wunused-function- Severity
- warning
- Message
unused function {}
Clang enables it by default.
- Code
-Wunused-getter-return-value- Severity
- warning
- Message
property access result unused - getters should not be used for side effects
- Code
-Wunused-label- Severity
- warning
- Message
unused label {}
Clang has 3 messages for this flag.
- Code
-Wunused-lambda-capture- Severity
- warning
- Message
lambda capture {} is not- Message
used- Message
required to be captured for this use
Unused. -Wunused-local-typedef
Clang has 3 messages for this flag.
- Code
-Wunused-local-typedef- Severity
- warning
- Message
unused- Message
typedef- Message
type alias
- Code
-Wunused-local-typedefs- Severity
- warning
- Code
-Wunused-macros- Severity
- warning
- Message
macro is not used
It also controls -Wunneeded-member-function.
- Code
-Wunused-member-function- Severity
- warning
- Message
unused member function {}
- Code
-Wunused-parameter- Severity
- warning
- Message
unused parameter {}
- Code
-Wunused-private-field- Severity
- warning
- Message
private field {} is not used
- Code
-Wunused-property-ivar- Severity
- warning
- Message
ivar {} which backs the property is not referenced in this property’s accessor
Clang enables it by default. Clang has 2 messages for this flag.
- Code
-Wunused-result- Severity
- warning
- Message
ignoring return value of function declared with {} attribute- Message
: {}
Unused. -Wunused-template
It also controls -Wunneeded-internal-declaration. Clang has 3 messages for this flag.
- Code
-Wunused-template- Severity
- warning
- Message
unused- Message
function- Message
variable
Clang enables it by default. It also controls -Wunevaluated-expression, -Wunused-comparison, -Wunused-result. Clang has 11 messages for this flag.
- Code
-Wunused-value- Severity
- warning
- Message
ignoring return value of function declared with {} attribute- Message
left operand of comma operator has no effect- Message
ignoring temporary created by a constructor declared with {} attribute- Message
: {}- Message
container access result unused - container access should not be used for side effects- Message
expression result unused- Message
ignoring- Message
return value
It also controls -Wunused-const-variable.
- Code
-Wunused-variable- Severity
- warning
- Message
unused variable {}
Clang enables it by default.
- Code
-Wunused-volatile-lvalue- Severity
- warning
- Message
expression result unused; assign into a variable to force a volatile load
- Code
-Wused-but-marked-unused- Severity
- warning
- Message
{} was marked unused but was used
Clang enables it by default. Clang has 5 messages for this flag.
- Code
-Wuser-defined-literals- Severity
- warning
- Message
user-defined literal suffixes- Message
<ERROR>- Message
not starting with ‘_’- Message
containing ‘__’- Message
; no literal will invoke this operator
Clang enables it by default.
- Code
-Wuser-defined-warnings- Severity
- warning
Clang enables it by default. Clang has 7 messages for this flag.
- Code
-Wvarargs- Severity
- warning
- Message
second argument to ‘va_start’ is not the last non-variadic parameter- Message
second argument to ‘va_arg’ is of array type {}; this va_arg has undefined behavior because arguments will never be compatible with array type- Message
second argument to ‘va_arg’ is of promotable type {}; this va_arg has undefined behavior because arguments will be promoted to {}- Message
passing- Message
an object that undergoes default argument promotion- Message
an object of reference type- Message
a parameter declared with the ‘register’ keyword
Clang has 3 messages for this flag.
- Code
-Wvariadic-macro-arguments-omitted- Severity
- warning
- Message
passing no argument for the ‘…’ parameter of a variadic macro is a C23 extension- Message
passing no argument for the ‘…’ parameter of a variadic macro is a C++20 extension- Message
passing no argument for the ‘…’ parameter of a variadic macro is incompatible with C standards before C23
Clang enables some of the diagnostics that it controls by default. Clang has 3 messages for this flag.
- Code
-Wvariadic-macros- Severity
- warning
- Message
named variadic macros are a GNU extension- Message
__VA_OPT__ can only appear in the expansion of a variadic macro- Message
variadic macros are a C99 feature
- Code
-Wvec-elem-size- Severity
- error
- Message
vector operands do not have the same elements sizes ({} and {})
Clang enables some of the diagnostics that it controls by default. Clang has 16 messages for this flag.
- Code
-Wvector-conversion- Severity
- warning
- Message
implicit conversion truncates vector: {} to {}- Message
incompatible vector types- Message
assigning to {} from {}- Message
assigning to different types- Message
passing {} to parameter of type {}- Message
passing to parameter of different type- Message
returning {} from a function with result type {}- Message
returning from function with different return type
- Code
-Wvector-conversions- Severity
- warning
Clang enables it by default. Clang has 3 messages for this flag.
- Code
-Wvexing-parse- Severity
- warning
- Message
empty parentheses interpreted as a function declaration- Message
parentheses were disambiguated as a function declaration- Message
parentheses were disambiguated as redundant parentheses around declaration of variable named {}
Clang enables it by default. Clang has 2 messages for this flag.
- Code
-Wvisibility- Severity
- warning
- Message
declaration of {} will not be visible outside of this function- Message
redefinition of {} will not be visible outside of this function
Clang enables some of the diagnostics that it controls by default. It also controls -Wvla-extension.
- Code
-Wvla- Severity
- warning
- Message
variable length array used
Clang enables some of the diagnostics that it controls by default. It also controls -Wvla-extension-static-assert. Clang has 2 messages for this flag.
- Code
-Wvla-cxx-extension- Severity
- warning
- Message
variable length arrays in C++ are a Clang extension- Message
variable length arrays in C++ are a Clang extension
Clang enables some of the diagnostics that it controls by default. It also controls -Wvla-cxx-extension.
- Code
-Wvla-extension- Severity
- warning
- Message
variable length arrays are a C99 feature
Clang enables some of the diagnostics that it controls by default. Clang has 2 messages for this flag.
- Code
-Wvla-extension-static-assert- Severity
- warning
- Message
variable length arrays in C++ are a Clang extension; did you mean to use ‘static_assert’?- Message
variable length arrays in C++ are a Clang extension; did you mean to use ‘static_assert’?
Clang enables it by default.
- Code
-Wvoid-pointer-to-enum-cast- Severity
- warning
- Message
cast to smaller integer type {} from {}
Clang enables it by default. It also controls -Wvoid-pointer-to-enum-cast.
- Code
-Wvoid-pointer-to-int-cast- Severity
- warning
- Message
cast to smaller integer type {} from {}
Clang enables it by default.
- Code
-Wvoid-ptr-dereference- Severity
- warning
- Message
ISO C does not allow indirection on operand of type {}
- Code
-Wvolatile-register-var- Severity
- warning