- Code
-Wlifetime-safety-use-after-scope- Severity
- warning
- Message
{} does not live long enough
- Code
-Wlifetime-safety-use-after-scope-moved- Severity
- warning
- Message
{} may not live long enough. This could be a false positive as the storage may have been moved later
It also controls -Wlifetime-safety-annotation-placement, -Wlifetime-safety-annotation-verification.
- Code
-Wlifetime-safety-validations- Severity
- warning
Clang enables it by default.
- Code
-Wlinker-warnings- Severity
- warning
- Message
linking module ‘{}’: {}
Clang enables it by default. Clang has 2 messages for this flag.
- Code
-Wliteral-conversion- Severity
- warning
- Message
implicit conversion from {} to {} changes value from {} to {}- Message
implicit conversion of out of range value from {} to {} is undefined
Clang enables it by default. Clang has 5 messages for this flag.
- Code
-Wliteral-range- Severity
- warning
- Message
floating-point comparison is always- Message
true- Message
false- Message
magnitude of floating-point constant too large for type {}; maximum is {}- Message
magnitude of floating-point constant too small for type {}; minimum is {}
Clang enables some of the diagnostics that it controls by default. It also controls -Wc++98-compat-local-type-template-args.
- Code
-Wlocal-type-template-args- Severity
- warning
- Message
template argument uses local type {}
Clang enables it by default. Clang has 3 messages for this flag.
- Code
-Wlogical-not-parentheses- Severity
- warning
- Message
logical not is only applied to the left hand side of this- Message
comparison- Message
bitwise operator
- Code
-Wlogical-op-parentheses- Severity
- warning
- Message
‘&&’ within ‘||’
It also controls -Wc++11-long-long.
- Code
-Wlong-long- Severity
- warning
- Message
‘long long’ is an extension when C99 mode is not enabled
It also controls -Wfor-loop-analysis, -Wrange-loop-analysis.
- Code
-Wloop-analysis- Severity
- warning
Clang enables it by default.
- Code
-Wmacro-redefined- Severity
- warning
- Message
{} macro redefined
Clang enables some of the diagnostics that it controls by default. Clang has 8 messages for this flag.
- Code
-Wmain- Severity
- warning
- Message
‘main’ should not be ‘extern “C”’- Message
referring to ‘main’ within an expression is a Clang extension- Message
‘main’ is not allowed to be declared _Noreturn- Message
‘main’ is not allowed to be declared variadic- Message
only one parameter on ‘main’ declaration- Message
variable named ‘main’ with external linkage has undefined behavior- Message
bool literal returned from ‘main’- Message
‘main’ should not be declared static
Clang enables it by default.
- Code
-Wmain-attached-to-named-module- Severity
- warning
- Message
‘main’ never has module linkage
Clang enables some of the diagnostics that it controls by default. Clang has 2 messages for this flag.
- Code
-Wmain-return-type- Severity
- warning
- Message
implicit ‘0’ return value from ‘main’ is a C99 extension- Message
return type of ‘main’ is not ‘int’
Clang enables it by default.
- Code
-Wmalformed-warning-check- Severity
- warning
- Message
__has_warning expected option name (e.g. “-Wundef”)
Clang enables it by default. Clang has 2 messages for this flag.
- Code
-Wmany-braces-around-scalar-init- Severity
- warning
- Message
too many braces around- Message
scalar
Clang enables it by default.
- Code
-Wmath-errno-enabled-with-veclib- Severity
- warning
- Message
math errno enabled by ‘{}’ after it was implicitly disabled by ‘{}’, this may limit the utilization of the vector library
Clang enables it by default.
- Code
-Wmathematical-notation-identifier-extension- Severity
- warning
- Message
mathematical notation character {} in an identifier is a Clang extension
Clang enables it by default. Clang has 2 messages for this flag.
- Code
-Wmatrix-conversion- Severity
- warning
- Message
implicit conversion truncates matrix: {} to {}- Message
implicit conversion turns matrix to scalar: {} to {}
- Code
-Wmatrix-conversions- Severity
- warning
Clang has 2 messages for this flag.
- Code
-Wmax-tokens- Severity
- warning
- Message
the number of preprocessor source tokens ({}) exceeds this token limit ({})- Message
the total number of preprocessor source tokens ({}) exceeds the token limit ({})
Clang enables it by default. Clang has 3 messages for this flag.
- Code
-Wmax-unsigned-zero- Severity
- warning
- Message
taking the max of- Message
a value and unsigned zero- Message
unsigned zero and a value
Clang enables it by default. Clang has 2 messages for this flag.
- Code
-Wmemset-transposed-args- Severity
- warning
- Message
‘size’ argument to memset is ‘0’- Message
setting buffer to a ‘sizeof’ expression
Clang enables it by default.
- Code
-Wmemsize-comparison- Severity
- warning
- Message
size argument in {} call is a comparison
Clang has 2 messages for this flag.
- Code
-Wmethod-signatures- Severity
- warning
- Message
conflicting parameter types in implementation of {}: {} vs {}- Message
conflicting return type in implementation of {}: {} vs {}
Clang enables some of the diagnostics that it controls by default. It also controls -Winconsistent-dllimport, -Wmicrosoft-abstract, -Wmicrosoft-anon-tag, -Wmicrosoft-cast, -Wmicrosoft-charize, -Wmicrosoft-comment-paste, -Wmicrosoft-const-init, -Wmicrosoft-cpp-macro, -Wmicrosoft-default-arg-redefinition, -Wmicrosoft-drectve-section, -Wmicrosoft-empty-enum, -Wmicrosoft-end-of-file and 21 more.
- Code
-Wmicrosoft- Severity
- warning
Clang enables it by default.
- Code
-Wmicrosoft-abstract- Severity
- warning
- Message
‘abstract’ keyword is a Microsoft extension
Clang enables some of the diagnostics that it controls by default. Clang has 6 messages for this flag.
- Code
-Wmicrosoft-anon-tag- Severity
- warning
- Message
types declared in an anonymous- Message
struct- Message
union- Message
anonymous- Message
structs- Message
unions
Clang enables it by default. Clang has 2 messages for this flag.
- Code
-Wmicrosoft-cast- Severity
- warning
- Message
static_cast between pointer-to-function and pointer-to-object is a Microsoft extension- Message
implicit conversion between pointer-to-function and pointer-to-object is a Microsoft extension
- Code
-Wmicrosoft-charize- Severity
- warning
- Message
charizing operator #@ is a Microsoft extension
Clang enables it by default. Clang has 2 messages for this flag.
- Code
-Wmicrosoft-const-init- Severity
- warning
- Message
default initialization of an object of const type {}- Message
without a user-provided default constructor
- Code
-Wmicrosoft-cpp-macro- Severity
- warning
- Message
C++ operator {} (aka {}) used as a macro name
Clang enables it by default.
- Code
-Wmicrosoft-default-arg-redefinition- Severity
- warning
- Message
redefinition of default argument
Clang enables it by default.
- Code
-Wmicrosoft-drectve-section- Severity
- warning
- Message
#pragma {}(“.drectve”) has undefined behavior, use #pragma comment(linker, …) instead
- Code
-Wmicrosoft-empty-enum- Severity
- warning
- Message
empty enumeration types are a Microsoft extension
- Code
-Wmicrosoft-end-of-file- Severity
- warning
- Message
treating Ctrl-Z as end-of-file is a Microsoft extension
Clang enables it by default.
- Code
-Wmicrosoft-enum-forward-reference- Severity
- warning
- Message
forward references to ‘enum’ types are a Microsoft extension
- Code
-Wmicrosoft-enum-value- Severity
- warning
- Message
enumerator value is not representable in the underlying type {}
Clang enables some of the diagnostics that it controls by default. Clang has 6 messages for this flag.
- Code
-Wmicrosoft-exception-spec- Severity
- warning
- Message
exception specification of ‘…’ is a Microsoft extension- Message
pointer to- Message
reference to- Message
exception specification in declaration does not match previous declaration- Message
exception specification in explicit instantiation does not match instantiated one- Message
exception specification of overriding function is more lax than base version
Clang enables it by default. Clang has 3 messages for this flag.
- Code
-Wmicrosoft-exists- Severity
- warning
- Message
dependent- Message
__if_not_exists- Message
__if_exists
Clang enables it by default.
- Code
-Wmicrosoft-explicit-constructor-call- Severity
- warning
- Message
explicit constructor calls are a Microsoft extension
- Code
-Wmicrosoft-fixed-enum- Severity
- warning
- Message
enumeration types with a fixed underlying type are a Microsoft extension
Clang has 7 messages for this flag.
- Code
-Wmicrosoft-flexible-array- Severity
- warning
- Message
flexible array member {} in otherwise empty- Message
struct- Message
interface- Message
union- Message
class- Message
enum- Message
flexible array member {} in a union is a Microsoft extension
Clang enables it by default.
- Code
-Wmicrosoft-goto- Severity
- warning
- Message
jump from this goto statement to its label is a Microsoft extension
Clang enables it by default.
- Code
-Wmicrosoft-inaccessible-base- Severity
- warning
- Message
accessing inaccessible direct base {} of {} is a Microsoft extension
Clang enables it by default.
- Code
-Wmicrosoft-include- Severity
- warning
- Message
#include resolved using non-portable Microsoft search rules as: {}
Clang enables it by default.
- Code
-Wmicrosoft-init-from-predefined- Severity
- warning
- Message
initializing an array from a {} predefined identifier is a Microsoft extension
Clang enables it by default. Clang has 2 messages for this flag.
- Code
-Wmicrosoft-inline-on-non-function- Severity
- warning
- Message
‘inline’ can only appear on functions- Message
and non-local variables
Clang enables it by default.
- Code
-Wmicrosoft-mutable-reference- Severity
- warning
- Message
‘mutable’ on a reference type is a Microsoft extension
Clang enables it by default.
- Code
-Wmicrosoft-pure-definition- Severity
- warning
- Message
function definition with pure-specifier is a Microsoft extension
- Code
-Wmicrosoft-redeclare-static- Severity
- warning
- Message
redeclaring non-static {} as static is a Microsoft extension
Clang enables it by default.
- Code
-Wmicrosoft-sealed- Severity
- warning
- Message
‘sealed’ keyword is a Microsoft extension
Clang enables it by default.
- Code
-Wmicrosoft-string-literal-from-predefined- Severity
- warning
- Message
expansion of predefined identifier ‘{}’ to a string literal is a Microsoft extension
Clang enables it by default. It also controls -Wmicrosoft-template-shadow. Clang has 20 messages for this flag.
- Code
-Wmicrosoft-template- Severity
- warning
- Message
duplicate explicit instantiation of {} ignored as a Microsoft extension- Message
use of member {} found via unqualified lookup into dependent bases of class templates is a Microsoft extension- Message
use of member {} before its declaration is a Microsoft extension- Message
using the undeclared type {} as a default template argument is a Microsoft extension- Message
non-type template argument containing a dereference operation is a Microsoft extension- Message
class template- Message
class template partial- Message
variable template
Clang enables it by default.
- Code
-Wmicrosoft-template-shadow- Severity
- warning
- Message
declaration of {} shadows template parameter
Clang enables it by default.
- Code
-Wmicrosoft-union-member-reference- Severity
- warning
- Message
union member {} has reference type {}, which is a Microsoft extension
Clang enables it by default.
- Code
-Wmicrosoft-unqualified-friend- Severity
- warning
- Message
unqualified friend declaration referring to type outside of the nearest enclosing namespace is a Microsoft extension; add a nested name specifier
Clang enables it by default.
- Code
-Wmicrosoft-using-decl- Severity
- warning
- Message
using declaration referring to inaccessible member ‘{}’ (which refers to accessible member ‘{}’) is a Microsoft compatibility extension
Clang enables it by default.
- Code
-Wmicrosoft-void-pseudo-dtor- Severity
- warning
- Message
pseudo-destructors on type void are a Microsoft extension
Clang enables it by default.
- Code
-Wmisexpect- Severity
- warning
- Message
potential performance regression from use of __builtin_expect(): annotation was correct on {} of profiled executions
Clang has 5 messages for this flag.
- Code
-Wmisleading-indentation- Severity
- warning
- Message
misleading indentation; statement is not part of the previous ‘- Message
if- Message
else- Message
for- Message
while
‘delete. -Wmismatched-new-delete
Clang enables it by default. Clang has 4 messages for this flag.
- Code
-Wmismatched-new-delete- Severity
- warning
- Message
‘delete- Message
[]- Message
[]- Message
[]
Clang enables it by default. Clang has 2 messages for this flag.
- Code
-Wmismatched-parameter-types- Severity
- warning
- Message
conflicting parameter types in implementation of {}- Message
: {} vs {}
Clang enables it by default. Clang has 2 messages for this flag.
- Code
-Wmismatched-return-types- Severity
- warning
- Message
conflicting return type in implementation of {}- Message
: {} vs {}
Clang has 17 messages for this flag.
- Code
-Wmismatched-tags- Severity
- warning
- Message
{} defined as- Message
a struct- Message
an interface- Message
a class- Message
template- Message
a struct- Message
an interface- Message
a class
- Code
-Wmissing-braces- Severity
- warning
- Message
suggest braces around initialization of subobject
Clang enables it by default.
- Code
-Wmissing-constinit- Severity
- warning
- Message
‘constinit’ specifier missing on initializing declaration of {}
Clang enables it by default. Clang has 4 messages for this flag.
- Code
-Wmissing-declarations- Severity
- warning
- Message
declaration does not declare anything- Message
‘{}’ is not permitted on a declaration of a type- Message
typedef requires a name- Message
‘{}’ ignored on this declaration
- Code
-Wmissing-designated-field-initializers- Severity
- warning
- Message
missing field {} initializer
Clang enables it by default.
- Code
-Wmissing-exception-spec- Severity
- warning
- Message
{} is missing exception specification ‘{}’
It also controls -Wmissing-designated-field-initializers.
- Code
-Wmissing-field-initializers- Severity
- warning
- Message
missing field {} initializer
- Code
-Wmissing-format-attribute- Severity
- warning
- Message
diagnostic behavior may be improved by adding the ‘{}’ attribute to the declaration of {}
- Code
-Wmissing-include-dirs- Severity
- warning
- Message
no such include directory: ‘{}’
- Code
-Wmissing-method-return-type- Severity
- warning
- Message
method has no return type specified; defaults to ‘id’
Clang enables it by default.
- Code
-Wmissing-multilib- Severity
- warning
- Message
no multilib found matching flags: {}
Clang enables it by default.
- Code
-Wmissing-noescape- Severity
- warning
- Message
parameter of overriding method should be annotated with __attribute__((noescape))
Clang has 3 messages for this flag.
- Code
-Wmissing-noreturn- Severity
- warning
- Message
block could be declared with attribute ‘noreturn’- Message
function- Message
method
Clang enables it by default.
- Code
-Wmissing-prototype-for-cc- Severity
- warning
- Message
function with no prototype cannot use the {} calling convention
- Code
-Wmissing-prototypes- Severity
- warning
- Message
no previous prototype for function {}
Clang enables it by default.
- Code
-Wmissing-selector-name- Severity
- warning
- Message
{} used as the name of the previous parameter rather than as part of the selector
Clang enables it by default.
- Code
-Wmissing-sysroot- Severity
- warning
- Message
no such sysroot directory: ‘{}’
- Code
-Wmissing-template-arg-list-after-template-kw- Severity
- error
- Message
a template argument list is expected after a name prefixed by the template keyword
- Code
-Wmissing-variable-declarations- Severity
- warning
- Message
no previous extern declaration for non-static variable {}
Clang enables it by default.
- Code
-Wmisspelled-assumption- Severity
- warning
- Message
unknown assumption string ‘{}’ may be misspelled; attribute is potentially ignored, did you mean ‘{}’?
Clang enables it by default.
- Code
-Wmix-packoffset- Severity
- warning
- Message
cannot mix packoffset elements with nonpackoffset elements in a cbuffer
Clang enables it by default. Clang has 2 messages for this flag.
- Code
-Wmodule-conflict- Severity
- warning
- Message
module ‘{}’ conflicts with already-imported module ‘{}’: {}- Message
module file ‘{}’ was validated as a system module and is now being imported as a non-system module; any difference in diagnostic options will be ignored
- Code
-Wmodule-file-config-mismatch- Severity
- error
- Message
precompiled file ‘{}’ cannot be loaded due to a configuration mismatch with the current compilation
Clang enables it by default.
- Code
-Wmodule-file-extension- Severity
- warning
- Message
duplicate module file extension block name ‘{}’
- Code
-Wmodule-file-mapping-mismatch- Severity
- warning
- Message
loaded module file ‘{}’ conflicts with imported file ‘{}’
Clang enables it by default.
- Code
-Wmodule-import-in-extern-c- Severity
- warning
- Message
import of C++ module ‘{}’ appears within extern “C” language linkage specification
- Code
-Wmodule-map-path-outside-directory- Severity
- warning
- Message
path refers outside of the module directory; such paths in implicitly discovered module maps are deprecated
Clang enables it by default.
- Code
-Wmodules-ambiguous-internal-linkage- Severity
- warning
- Message
ambiguous use of internal linkage declaration {} defined in multiple modules
- Code
-Wmodules-import-nested-redundant- Severity
- error
- Message
redundant #include of module ‘{}’ appears within {}
Clang enables some of the diagnostics that it controls by default. It also controls -Warray-parameter, -Wbool-operation, -Wcast-of-sel-type, -Wchar-subscripts, -Wcomment, -Wdelete-non-virtual-dtor, -Wextern-c-compat, -Wfor-loop-analysis, -Wformat, -Wframe-address, -Wimplicit, -Winfinite-recursion and 25 more.
- Code
-Wmost- Severity
- warning
It also controls -Wpessimizing-move, -Wredundant-move, -Wreturn-std-move, -Wself-move.
- Code
-Wmove- Severity
- warning
- Code
-Wms-bitfield-padding- Severity
- warning
- Message
bit-field {} of type {} has a different storage size than the preceding bit-field ({} vs {} bytes) and will not be packed under the Microsoft ABI
- Code
-Wmsvc-include- Severity
- warning
Clang enables it by default.
- Code
-Wmsvc-not-found- Severity
- warning
- Message
unable to find a Visual Studio installation; try running Clang from a developer command prompt
Clang enables it by default.
- Code
-Wmulti-gpu- Severity
- warning
- Message
multiple {} architectures are detected: {}; only the first one is used for ‘{}’
Clang enables it by default.
- Code
-Wmultichar- Severity
- warning
- Message
multi-character character constant
Clang enables it by default.
- Code
-Wmultilib-not-found- Severity
- warning
- Message
no multilib structure encoded for Arm, Aarch64 and PPC targets
Clang enables it by default.
- Code
-Wmultiple-move-vbase- Severity
- warning
- Message
defaulted move assignment operator of {} will move assign virtual base class {} multiple times
Use of. -Wnan-infinity-disabled
Clang enables it by default. Clang has 4 messages for this flag.
- Code
-Wnan-infinity-disabled- Severity
- warning
- Message
use of- Message
infinity- Message
NaN- Message
via a macro
- Code
-Wnarrowing- Severity
- warning
Clang has 3 messages for this flag.
- Code
-Wnested-anon-types- Severity
- warning
- Message
anonymous types declared in an anonymous- Message
struct- Message
union
- Code
-Wnested-externs- Severity
- warning
Clang enables it by default. Clang has 2 messages for this flag.
- Code
-Wnew-returns-null- Severity
- warning
- Message
{} should not return a null pointer unless it is declared ‘throw()’- Message
or ‘noexcept’
- Code
-Wnewline-eof- Severity
- warning
- Message
no newline at end of file
Clang enables it by default. Clang has 3 messages for this flag.
- Code
-Wnoderef- Severity
- warning
- Message
dereferencing {}; was declared with a ‘noderef’ type- Message
dereferencing expression marked as ‘noderef’- Message
casting to dereferenceable pointer removes ‘noderef’ attribute
- Code
-Wnoexcept-type- Severity
- warning
Clang enables it by default. Clang has 3 messages for this flag.
- Code
-Wnon-c-typedef-for-linkage- Severity
- warning
- Message
anonymous non-C-compatible type given name for linkage purposes by- Message
typedef- Message
alias
Clang enables some of the diagnostics that it controls by default. It also controls -Wconversion, -Wliteral-range, -Wsign-compare.
- Code
-Wnon-gcc- Severity
- warning
Clang enables it by default.
- Code
-Wnon-literal-null-conversion- Severity
- warning
- Message
expression which evaluates to zero treated as a null pointer constant of type {}
- Code
-Wnon-modular-include-in-framework-module- Severity
- warning
- Message
include of non-modular header inside framework module ‘{}’: ‘{}’
It also controls -Wnon-modular-include-in-framework-module.
- Code
-Wnon-modular-include-in-module- Severity
- warning
- Message
include of non-modular header inside module ‘{}’: ‘{}’
Clang has 16 messages for this flag.
- Code
-Wnon-pod-varargs- Severity
- error
- Message
cannot pass object of- Message
non-POD- Message
non-trivial- Message
function- Message
block- Message
method- Message
constructor- Message
cannot pass
Clang enables it by default.
- Code
-Wnon-power-of-two-alignment- Severity
- warning
- Message
requested alignment is not a power of 2
- Code
-Wnon-virtual-dtor- Severity
- warning
- Message
{} has virtual functions but non-virtual destructor
Clang enables it by default. Clang has 4 messages for this flag.
- Code
-Wnonnull- Severity
- warning
- Message
null passed to a callee that requires a non-null argument- Message
null returned from- Message
function- Message
method
- Code
-Wnonportable-cfstrings- Severity
- warning
Clang enables some of the diagnostics that it controls by default. It also controls -Wnonportable-include-path-separator. Clang has 4 messages for this flag.
- Code
-Wnonportable-include-path- Severity
- warning
- Message
non-portable path to file ‘{}’; specified path differs in case from file name on disk- Message
non-portable path to file ‘{}’; specified path contains trailing- Message
whitespace- Message
dot
- Code
-Wnonportable-include-path-separator- Severity
- warning
- Message
non-portable path to file ‘{}’; specified path contains backslashes
Clang enables it by default.
- Code
-Wnonportable-private-apinotes-path- Severity
- warning
- Message
private API notes file for module ‘{}’ should be named ‘{}_private.apinotes’, not ‘{}’
- Code
-Wnonportable-private-system-apinotes-path- Severity
- warning
- Message
private API notes file for module ‘{}’ should be named ‘{}_private.apinotes’, not ‘{}’
Clang enables it by default. Clang has 2 messages for this flag.
- Code
-Wnonportable-sycl- Severity
- warning
- Message
{} attribute does not appear on the first declaration- Message
{} is not a valid SYCL kernel name type; a non-union class type is required
Clang has 4 messages for this flag.
- Code
-Wnonportable-system-include-path- Severity
- warning
- Message
non-portable path to file ‘{}’; specified path differs in case from file name on disk- Message
non-portable path to file ‘{}’; specified path contains trailing- Message
whitespace- Message
dot
Clang enables it by default.
- Code
-Wnonportable-vector-initialization- Severity
- warning
- Message
vector initializers are not compatible with NEON intrinsics in big endian mode
Clang enables it by default. It also controls -Wnontrivial-memcall. Clang has 6 messages for this flag.
- Code
-Wnontrivial-memaccess- Severity
- warning
- Message
destination for- Message
source of- Message
first operand of- Message
second operand of- Message
primitive-default-initialize- Message
primitive-copy
Clang enables it by default.
- Code
-Wnontrivial-memcall- Severity
- warning
- Message
first argument in call to {} is a pointer to non-trivially copyable type {}
- Code
-Wnrvo- Severity
- warning
- Message
not eliding copy on return
Clang enables it by default.
- Code
-Wnsconsumed-mismatch- Severity
- warning
- Message
overriding method has mismatched ns_consumed attribute on its parameter
Clang enables it by default.
- Code
-WNSObject-attribute- Severity
- warning
- Message
‘NSObject’ attribute may be put on a typedef only; attribute is ignored
Clang enables it by default. Clang has 3 messages for this flag.
- Code
-Wnsreturns-mismatch- Severity
- warning
- Message
overriding method has mismatched ns_returns_- Message
not_retained- Message
retained
Clang enables it by default. Clang has 4 messages for this flag.
- Code
-Wnull-arithmetic- Severity
- warning
- Message
use of NULL in arithmetic operation- Message
comparison between NULL and non-pointer- Message
({} and NULL)- Message
(NULL and {})
Clang enables it by default. Clang has 4 messages for this flag.
- Code
-Wnull-character- Severity
- warning
- Message
null character(s) preserved in- Message
char- Message
string- Message
null character ignored
Clang enables it by default. Clang has 3 messages for this flag.
- Code
-Wnull-conversion- Severity
- warning
- Message
implicit conversion of- Message
NULL- Message
nullptr
Clang enables it by default. Clang has 2 messages for this flag.
- Code
-Wnull-dereference- Severity
- warning
- Message
binding dereferenced null pointer to reference has undefined behavior- Message
indirection of non-volatile null pointer will be deleted, not trap
It also controls -Wgnu-null-pointer-arithmetic. Clang has 2 messages for this flag.
- Code
-Wnull-pointer-arithmetic- Severity
- warning
- Message
performing pointer arithmetic on a null pointer has undefined behavior- Message
if the offset is nonzero
Clang has 3 messages for this flag.
- Code
-Wnull-pointer-subtraction- Severity
- warning
- Message
performing pointer subtraction with a null pointer- Message
has- Message
may have
Clang enables it by default. Clang has 5 messages for this flag.
- Code
-Wnullability- Severity
- warning
- Message
conflicting nullability specifier on parameter types, {} conflicts with existing specifier {}- Message
conflicting nullability specifier on return types, {} conflicts with existing specifier {}- Message
nullability specifier {} conflicts with existing specifier {}- Message
synthesized setter {} for null_resettable property {} does not handle nil- Message
duplicate nullability specifier {}
Pointer. -Wnullability-completeness
Clang enables it by default. It also controls -Wnullability-completeness-on-arrays. Clang has 3 messages for this flag.
- Code
-Wnullability-completeness- Severity
- warning
- Message
pointer- Message
block pointer- Message
member pointer
Clang enables it by default.
- Code
-Wnullability-completeness-on-arrays- Severity
- warning
- Message
array parameter is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified)
Clang has 6 messages for this flag.
- Code
-Wnullability-declspec- Severity
- error
- Message
nullability specifier {} cannot be applied to non-pointer type {}; did you mean to apply the specifier to the- Message
pointer- Message
block pointer- Message
member pointer- Message
function pointer- Message
member function pointer
- Code
-Wnullability-extension- Severity
- warning
- Message
type nullability specifier {} is a Clang extension
Clang enables it by default. Clang has 3 messages for this flag.
- Code
-Wnullability-inferred-on-nested-type- Severity
- warning
- Message
inferring ‘_Nonnull’ for pointer type within- Message
array- Message
reference
- Code
-Wnullable-to-nonnull-conversion- Severity
- warning
- Message
implicit conversion from nullable pointer {} to non-nullable pointer type {}
Clang has 9 messages for this flag.
- Code
-Wnvcc-compat- Severity
- warning
- Message
target-attribute based function overloads are not supported by NVCC and will be treated as a function redeclaration:new declaration is- Message
__device__- Message
__global__- Message
__host__- Message
__host__ __device__- Message
__device__- Message
__global__- Message
__host__
Clang enables it by default. Clang has 2 messages for this flag.
- Code
-Wobjc-autosynthesis-property-ivar-name-match- Severity
- warning
- Message
autosynthesized property {} will use- Message
synthesized
Clang enables it by default.
- Code
-Wobjc-bool-constant-conversion- Severity
- warning
- Message
implicit conversion from constant value {} to ‘BOOL’; the only well defined values for ‘BOOL’ are YES and NO
Clang enables it by default.
- Code
-Wobjc-boxing- Severity
- warning
- Message
string is ill-formed as UTF-8 and will become a null {} when boxed
Clang enables it by default.
- Code
-Wobjc-circular-container- Severity
- warning
- Message
adding {} to {} might cause circular dependency in container
- Code
-Wobjc-cocoa-api- Severity
- warning
Clang enables it by default. Clang has 6 messages for this flag.
- Code
-Wobjc-designated-initializers- Severity
- warning
- Message
designated initializer missing a ‘super’ call to a designated initializer of the super class- Message
designated initializer invoked a non-designated initializer- Message
designated initializer should only invoke a designated initializer on ‘super’- Message
method override for the designated initializer of the superclass {} not found- Message
convenience initializer missing a ‘self’ call to another initializer- Message
convenience initializer should not invoke an initializer on ‘super’
Clang enables it by default.
- Code
-Wobjc-dictionary-duplicate-keys- Severity
- warning
- Message
duplicate key in dictionary literal
Clang enables it by default.
- Code
-Wobjc-dictionary-invalid-utf8-key- Severity
- warning
- Message
dictionary key is ill-formed as UTF-8 and will be truncated in a static constant dictionary, so it may not be found at runtime
Clang enables it by default.
- Code
-Wobjc-duplicate-category-definition- Severity
- warning
- Message
duplicate definition of category {} on interface {}
Clang enables it by default. Clang has 2 messages for this flag.
- Code
-Wobjc-flexible-array- Severity
- warning
- Message
field {} can overwrite instance variable {} with variable sized type {} in superclass {}- Message
field {} with variable sized type {} is not visible to subclasses and can conflict with their instance variables
Clang enables it by default.
- Code
-Wobjc-forward-class-redefinition- Severity
- warning
- Message
redefinition of forward class {} of a typedef name of an object type is ignored
- Code
-Wobjc-interface-ivars- Severity
- warning
- Message
declaration of instance variables in the interface is deprecated
Clang enables it by default. It also controls -Wobjc-string-compare. Clang has 5 messages for this flag.
- Code
-Wobjc-literal-compare- Severity
- warning
- Message
direct comparison of- Message
an array literal- Message
a dictionary literal- Message
a numeric literal- Message
a boxed expression
Clang enables it by default. Clang has 5 messages for this flag.
- Code
-Wobjc-literal-conversion- Severity
- warning
- Message
implicit boolean conversion of Objective-C object literal always evaluates to true- Message
object of type {} is not compatible with- Message
array element type- Message
dictionary key type- Message
dictionary value type
Clang enables it by default.
- Code
-Wobjc-macro-redefinition- Severity
- warning
- Message
ignoring redefinition of Objective-C qualifier macro
- Code
-Wobjc-messaging-id- Severity
- warning
- Message
messaging unqualified id
Clang enables it by default. Clang has 6 messages for this flag.
- Code
-Wobjc-method-access- Severity
- warning
- Message
class method {} not found (return type defaults to ‘id’)- Message
class method {} not found (return type defaults to ‘id’); did you mean {}?- Message
instance method {} not found (return type defaults to ‘id’)- Message
instance method {} not found (return type defaults to ‘id’); did you mean {}?- Message
instance method {} found instead of class method {}- Message
instance method {} is being used on ‘Class’ which is not in the root class
- Code
-Wobjc-missing-property-synthesis- Severity
- warning
- Message
auto property synthesis is synthesizing property not explicitly synthesized
Clang enables it by default.
- Code
-Wobjc-missing-super-calls- Severity
- warning
- Message
method possibly missing a [super {}] call
Clang enables it by default.
- Code
-Wobjc-multiple-method-names- Severity
- warning
- Message
multiple methods named {} found
Clang enables it by default.
- Code
-Wobjc-noncopy-retain-block-property- Severity
- warning
- Message
retain’ed block property does not copy the block - use copy attribute instead
Clang enables it by default.
- Code
-Wobjc-nonunified-exceptions- Severity
- warning
- Message
cannot catch an exception thrown with @throw in C++ in the non-unified exception model
- Code
-Wobjc-property-assign-on-object-type- Severity
- warning
- Message
‘assign’ property of object type may become a dangling reference; consider using ‘unsafe_unretained’
Clang enables it by default. Clang has 4 messages for this flag.
- Code
-Wobjc-property-implementation- Severity
- warning
- Message
class property {} requires method {} to be defined - use @dynamic or provide a method implementation in this class implementation- Message
class property {} requires method {} to be defined - use @dynamic or provide a method implementation in this category- Message
property {} requires method {} to be defined - use @synthesize, @dynamic or provide a method implementation in this class implementation- Message
property {} requires method {} to be defined - use @dynamic or provide a method implementation in this category
Clang enables it by default.
- Code
-Wobjc-property-implicit-mismatch- Severity
- warning
- Message
primary property declaration is implicitly strong while redeclaration in class extension is weak
Clang enables it by default.
- Code
-Wobjc-property-matches-cocoa-ownership-rule- Severity
- warning
- Message
property follows Cocoa naming convention for returning ‘owned’ objects
Clang enables it by default. Clang has 2 messages for this flag.
- Code
-Wobjc-property-no-attribute- Severity
- warning
- Message
default property attribute ‘assign’ not appropriate for object- Message
no ‘assign’, ‘retain’, or ‘copy’ attribute is specified - ‘assign’ is assumed
Clang enables it by default. Clang has 3 messages for this flag.
- Code
-Wobjc-property-synthesis- Severity
- warning
- Message
auto property synthesis will not synthesize property {}; it will be implemented by its superclass, use @dynamic to acknowledge intention- Message
auto property synthesis will not synthesize property {} because it is ‘readwrite’ but it will be synthesized ‘readonly’ via another property- Message
auto property synthesis will not synthesize property {} because it cannot share an ivar with another synthesized property
Clang enables it by default.
- Code
-Wobjc-protocol-method-implementation- Severity
- warning
- Message
category is implementing a method which will also be implemented by its primary class
Clang enables it by default.
- Code
-Wobjc-protocol-property-synthesis- Severity
- warning
- Message
auto property synthesis will not synthesize property {} declared in protocol {}
Clang enables it by default.
- Code
-Wobjc-protocol-qualifiers- Severity
- warning
- Message
parameterized class {} already conforms to the protocols listed; did you forget a ‘*’?
Clang enables it by default.
- Code
-Wobjc-readonly-with-setter-property- Severity
- warning
- Message
setter cannot be specified for a readonly property
- Code
-Wobjc-redundant-api-use- Severity
- warning
Clang enables it by default.
- Code
-Wobjc-redundant-literal-use- Severity
- warning
- Message
using {} with a literal is redundant
Clang enables it by default.
- Code
-Wobjc-root-class- Severity
- warning
- Message
class {} defined without specifying a base class
Clang enables some of the diagnostics that it controls by default. It also controls -Wobjc-bool-constant-conversion, -Wobjc-signed-char-bool-implicit-float-conversion, -Wobjc-signed-char-bool-implicit-int-conversion, -Wtautological-objc-bool-compare.
- Code
-Wobjc-signed-char-bool- Severity
- warning
Clang enables it by default.
- Code
-Wobjc-signed-char-bool-implicit-float-conversion- Severity
- warning
- Message
implicit conversion from floating-point type {} to ‘BOOL’
- Code
-Wobjc-signed-char-bool-implicit-int-conversion- Severity
- warning
- Message
implicit conversion from integral type {} to ‘BOOL’
Clang enables it by default.
- Code
-Wobjc-string-compare- Severity
- warning
- Message
direct comparison of a string literal has undefined behavior
Clang enables it by default.
- Code
-Wobjc-string-concatenation- Severity
- warning
- Message
concatenated NSString literal for an NSArray expression - possibly missing a comma
Clang enables it by default. Clang has 4 messages for this flag.
- Code
-Wobjc-unsafe-perform-selector- Severity
- warning
- Message
{} is incompatible with selectors that return a- Message
struct- Message
union- Message
vector
- Code
-Woctal-prefix-extension- Severity
- warning
- Message
octal integer literals are a Clang extension
Clang enables it by default. Clang has 32 messages for this flag.
- Code
-Wodr- Severity
- warning
- Message
template parameter lists have a different number of parameters ({} vs {})- Message
template parameter has different kinds in different translation units- Message
field {} declared with incompatible types in different translation units ({} vs. {})- Message
external function {} declared with incompatible types in different translation units ({} vs. {})- Message
instance variable {} declared with incompatible types in different translation units ({} vs. {})- Message
non-type template parameter declared with incompatible types in different translation units ({} vs. {})- Message
class- Message
instance
- Code
-Wold-style-cast- Severity
- warning
- Message
use of old-style cast
- Code
-Wold-style-definition- Severity
- warning
- Code
-Wopenacc- Severity
- warning
Clang enables it by default.
- Code
-Wopenacc-cache-var-inside-loop- Severity
- warning
- Message
OpenACC variable in ‘cache’ directive was not declared outside of the associated ‘loop’ directive; directive has no effect
Clang enables it by default.
- Code
-Wopenacc-confusing-routine-name- Severity
- warning
- Message
OpenACC ‘routine’ directive with a name refers to a function with the same name as the function on the following line; this may be unintended
Clang enables it by default.
- Code
-Wopenacc-deprecated-clause-alias- Severity
- warning
- Message
OpenACC clause name ‘{}’ is a deprecated clause name and is now an alias for ‘{}’