Diagnostic flags in Clang#

Introduction#

This page lists the diagnostic flags currently supported by Clang.

Diagnostic flags#

-W#

Synonym for -Wextra.

-W#pragma-messages#

This diagnostic is enabled by default.

Diagnostic text:

The text of this diagnostic is not controlled by Clang.

-W#warnings#

This diagnostic is enabled by default.

Diagnostic text:

The text of this diagnostic is not controlled by Clang.

-WCFString-literal#

This diagnostic is enabled by default.

Diagnostic text:

warning: input conversion stopped due to an input byte that does not belong to the input codeset UTF-8

-WCL4#

Some of the diagnostics controlled by this flag are enabled by default.

Controls -Wall, -Wextra.

-WIndependentClass-attribute#

This diagnostic is enabled by default.

Diagnostic text:

warning: ‘objc_independent_class’ attribute may be put on a typedef only; attribute is ignored

warning: ‘objc_independent_class’ attribute may be put on Objective-C object pointer type only; attribute is ignored

-WNSObject-attribute#

This diagnostic is enabled by default.

Diagnostic text:

warning: ‘NSObject’ attribute may be put on a typedef only; attribute is ignored

-WTU-local-entity-exposure#

This diagnostic is enabled by default.

Diagnostic text:

warning: TU local entity A is exposed

-Waarch64-sme-attributes#

Some of the diagnostics controlled by this flag are enabled by default.

Diagnostic text:

warning: always_inline function B and its caller A have mismatching C attributes, B may not be inlined

warning: 

returning

passing

 a VL-dependent argument 

from

to

 a locally streaming function is undefined behaviour when the streaming and non-streaming vector lengths are different at runtime

warning: 

returning

passing

 a VL-dependent argument 

from

to

 a 

non-streaming

streaming

 function is undefined behaviour when the streaming-compatible caller is

 not

 in streaming mode, because the streaming vector length (C bit) and non-streaming vector length (D bit) differ

warning: 

returning

passing

 a VL-dependent argument 

from

to

 a function with a different streaming-mode is undefined behaviour when the streaming and non-streaming vector lengths are different at runtime

-Wabi#

This diagnostic flag exists for GCC compatibility, and has no effect in Clang.

-Wabsolute-value#

This diagnostic is enabled by default.

Diagnostic text:

warning: absolute value function A given an argument of type B but has parameter of type C which may cause truncation of value

warning: taking the absolute value of 

pointer

function

array

 type B is suspicious

warning: taking the absolute value of unsigned type A has no effect

warning: using 

integer

floating point

complex

 absolute value function A when argument is of 

integer

floating point

complex

 type

-Wabstract-final-class#

This diagnostic is enabled by default.

Diagnostic text:

warning: abstract class is marked ‘

final

sealed

‘

-Wabstract-vbase-init#

Diagnostic text:

warning: initializer for virtual base class A of abstract class B will never be used

-Waddress#

This diagnostic is enabled by default.

Controls -Wpointer-bool-conversion, -Wstring-compare, -Wtautological-pointer-compare.

-Waddress-of-packed-member#

This diagnostic is enabled by default.

Diagnostic text:

warning: taking address of packed member A of class or structure B may result in an unaligned pointer value

-Waddress-of-temporary#

This diagnostic is an error by default, but the flag -Wno-address-of-temporary can be used to disable the error.

Diagnostic text:

error: taking the address of a temporary object of type A

-Waggregate-return#

This diagnostic flag exists for GCC compatibility, and has no effect in Clang.

-Waix-compat#

This diagnostic is enabled by default.

Diagnostic text:

warning: alignment of 16 bytes for a struct member is not binary compatible with IBM XL C/C++ for AIX 16.1.0 or older

warning: #pragma align(packed) may not be compatible with objects generated with AIX XL C/C++

-Walias-template-in-declaration-name#

This diagnostic is enabled by default.

Diagnostic text:

warning: a declarative nested name specifier cannot name an alias template

-Walign-mismatch#

This diagnostic is enabled by default.

Diagnostic text:

warning: passing A-byte aligned argument to B-byte aligned parameter C

 of E

 may result in an unaligned pointer access

-Wall#

Some of the diagnostics controlled by this flag are enabled by default.

Controls -Wmisleading-indentation, -Wmost, -Wpacked-non-pod, -Wparentheses, -Wswitch, -Wswitch-bool, -Wvla-cxx-extension.

-Walloc-size#

This diagnostic is enabled by default.

Diagnostic text:

warning: allocation of insufficient size ‘A’ for type B with size ‘C’

-Walloca#

Diagnostic text:

warning: use of function A is discouraged; there is no way to check for failure but failure may still occur, resulting in a possibly exploitable security vulnerability

-Walloca-with-align-alignof#

This diagnostic is enabled by default.

Diagnostic text:

warning: second argument to __builtin_alloca_with_align is supposed to be in bits

-Walways-inline-coroutine#

This diagnostic is enabled by default.

Diagnostic text:

warning: this coroutine may be split into pieces; not every piece is guaranteed to be inlined

-Wambiguous-delete#

This diagnostic is enabled by default.

Diagnostic text:

warning: multiple suitable A functions for B; no ‘operator delete’ function will be invoked if initialization throws an exception

-Wambiguous-ellipsis#

This diagnostic is enabled by default.

Diagnostic text:

warning: ‘…’ in this location creates a C-style varargs function

, not a function parameter pack

-Wambiguous-macro#

This diagnostic is enabled by default.

Diagnostic text:

warning: ambiguous expansion of macro A

-Wambiguous-member-template#

This diagnostic is enabled by default.

Diagnostic text:

warning: lookup of A in member access expression is ambiguous; using member of B

-Wambiguous-reversed-operator#

This diagnostic is enabled by default.

Diagnostic text:

warning: ISO C++20 considers use of overloaded operator ‘A’ (with operand types B and C) to be ambiguous despite there being a unique best viable function

 with non-reversed arguments

-Wamdgpu-av#

This diagnostic is enabled by default.

Diagnostic text:

warning: A attribute only applies to atomic expressions or Clang atomic builtins

warning: A attribute can only be applied to an expression

-Wamdgpu-unguarded-builtin-usage#

Diagnostic text:

warning: the ‘A’ ASM sequence might be invalid for some AMDGPU targets

warning: A might be unavailable on some AMDGPU targets

-Wamdgpu-wait-event-mask#

This diagnostic is enabled by default.

Diagnostic text:

warning: event mask has no effect for target

-Wanalyzer-incompatible-plugin#

This diagnostic is enabled by default.

Diagnostic text:

warning: checker plugin ‘A’ is not compatible with this version of the analyzer

-Wandroid-unversioned-fallback#

This diagnostic is enabled by default.

Diagnostic text:

warning: using unversioned Android target directory A for target B; unversioned directories will not be used in Clang 19 – provide a versioned directory for the target version or lower instead

-Wanon-enum-enum-conversion#

Some of the diagnostics controlled by this flag are enabled by default.

Also controls -Wdeprecated-anon-enum-enum-conversion.

Diagnostic text:

warning: 

arithmetic between

bitwise operation between

comparison of

conditional expression between

compound assignment of

 different enumeration types

 (B and C)

-Wanonymous-pack-parens#

This diagnostic is enabled by default.

Diagnostic text:

warning: ISO C++11 requires a parenthesized pack declaration to have a name

-Wapinotes#

This diagnostic is enabled by default.

Diagnostic text:

The text of this diagnostic is not controlled by Clang.

-Warc#

This diagnostic is enabled by default.

Controls -Warc-non-pod-memaccess, -Warc-retain-cycles, -Warc-unsafe-retained-assign.

-Warc-bridge-casts-disallowed-in-nonarc#

This diagnostic is enabled by default.

Diagnostic text:

warning: ‘A’ casts have no effect when not using ARC

-Warc-maybe-repeated-use-of-weak#

Diagnostic text:

warning: weak 

variable

property

implicit property

instance variable

 B may be accessed multiple times in this 

function

method

block

lambda

 and may be unpredictably set to nil; assign to a strong variable to keep the object alive

-Warc-non-pod-memaccess#

This diagnostic is enabled by default.

Diagnostic text:

warning: 

destination for

source of

 this B call is a pointer to ownership-qualified type C

-Warc-performSelector-leaks#

This diagnostic is enabled by default.

Diagnostic text:

warning: performSelector may cause a leak because its selector is unknown

-Warc-repeated-use-of-weak#

Also controls -Warc-maybe-repeated-use-of-weak.

Diagnostic text:

warning: weak 

variable

property

implicit property

instance variable

 B is accessed multiple times in this 

function

method

block

lambda

 but may be unpredictably set to nil; assign to a strong variable to keep the object alive

-Warc-retain-cycles#

This diagnostic is enabled by default.

Diagnostic text:

warning: capturing A strongly in this block is likely to lead to a retain cycle

-Warc-unsafe-retained-assign#

This diagnostic is enabled by default.

Diagnostic text:

warning: assigning 

array literal

dictionary literal

numeric literal

boxed expression

<should not happen>

block literal

 to a weak 

property

variable

; object will be released after assignment

warning: assigning retained object to 

weak

unsafe_unretained

 

property

variable

; object will be released after assignment

warning: assigning retained object to unsafe property; object will be released after assignment

-Wargument-outside-range#

This diagnostic is an error by default, but the flag -Wno-argument-outside-range can be used to disable the error.

Diagnostic text:

error: argument value A is outside the valid range [B, C]

-Wargument-undefined-behaviour#

This diagnostic is enabled by default.

Diagnostic text:

warning: argument value A will result in undefined behaviour

-Warm-interrupt-save-fp-no-vfp-unit#

This diagnostic is enabled by default.

Diagnostic text:

warning: `interrupt_save_fp` only applies to targets that have a VFP unit enabled for this compilation; this will be treated as a regular `interrupt` attribute

-Warm-interrupt-vfp-clobber#

This diagnostic is enabled by default.

Diagnostic text:

warning: interrupt service routine with vfp enabled may clobber the interruptee’s vfp state; consider using the `interrupt_save_fp` attribute to prevent this behavior

-Warray-bounds#

This diagnostic is enabled by default.

Diagnostic text:

warning: array index A is past the end of the array (that has type B

, cast to D

)

warning: array index A refers past the last possible element for an array in B-bit address space containing C-bit (D-byte) elements (max possible E element

s

)

warning: array index A is before the beginning of the array

warning: the pointer incremented by A refers past the last possible element for an array in B-bit address space containing C-bit (D-byte) elements (max possible E element

s

)

warning: array argument is too small; 

contains A elements

is of size A

, callee requires at least B

-Warray-bounds-pointer-arithmetic#

Diagnostic text:

warning: the pointer incremented by A refers past the end of the array (that has type B)

warning: the pointer decremented by A refers before the beginning of the array

-Warray-compare#

This diagnostic is enabled by default.

Diagnostic text:

warning: comparison between two arrays compare their addresses and will be deprecated in c++20; to compare array addresses, use unary ‘+’ to decay operands to pointers

-Warray-compare-cxx26#

This diagnostic is an error by default, but the flag -Wno-array-compare-cxx26 can be used to disable the error.

Diagnostic text:

error: comparison between two arrays is ill-formed in C++26; to compare array addresses, use unary ‘+’ to decay operands to pointers

-Warray-parameter#

Diagnostic text:

warning: argument A of type B with mismatched bound

-Wasm#

Synonym for -Wasm-operand-widths.

-Wasm-operand-widths#

This diagnostic is enabled by default.

Diagnostic text:

warning: value size does not match register size specified by the constraint and modifier

-Wassign-enum#

Diagnostic text:

warning: integer constant not in range of enumerated type A

-Wassume#

This diagnostic is enabled by default.

Diagnostic text:

warning: assumption is ignored because it contains (potential) side-effects

-Wat-protocol#

This diagnostic flag exists for GCC compatibility, and has no effect in Clang.

-Watimport-in-framework-header#

This diagnostic is enabled by default.

Diagnostic text:

warning: use of ‘@import’ in framework header is discouraged, including this header requires -fmodules

-Watomic-access#

This diagnostic is an error by default, but the flag -Wno-atomic-access can be used to disable the error.

Diagnostic text:

error: accessing a member of an atomic structure or union is undefined behavior

-Watomic-alignment#

This diagnostic is enabled by default.

Diagnostic text:

warning: misaligned atomic operation may incur significant performance penalty; the expected alignment (A bytes) exceeds the actual alignment (B bytes)

warning: large atomic operation may incur significant performance penalty; the access size (A bytes) exceeds the max lock-free size (B bytes)

-Watomic-hint-type#

This diagnostic is enabled by default.

Diagnostic text:

warning: unrecognised hint type argument to atomic hint operation (A)

-Watomic-implicit-seq-cst#

Diagnostic text:

warning: implicit use of sequentially-consistent atomic may incur stronger memory barriers than necessary

-Watomic-memory-ordering#

This diagnostic is enabled by default.

Diagnostic text:

warning: 

success 

failure 

memory order argument to atomic operation is invalid

-Watomic-properties#

Controls -Wcustom-atomic-properties, -Wimplicit-atomic-properties.

-Watomic-property-with-user-defined-accessor#

This diagnostic is enabled by default.

Diagnostic text:

warning: writable atomic property A cannot pair a synthesized 

getter

setter

 with a user defined 

getter

setter

-Wattribute-alias#

This diagnostic is enabled by default.

Diagnostic text:

warning: alias and aliasee have different types A and B

-Wattribute-packed-for-bitfield#

This diagnostic is enabled by default.

Diagnostic text:

warning: ‘packed’ attribute was ignored on bit-fields with single-byte alignment in older versions of GCC and Clang

-Wattribute-preprocessor-tokens#

Diagnostic text:

warning: ‘A’ is not allowed in an attribute argument list

-Wattribute-statement#

This diagnostic is enabled by default.

Diagnostic text:

error: A attribute minimum and maximum arguments are equal

warning: attribute ‘WaveSize’ is not supported for the SPIR-V target; consider using VK_EXT_subgroup_size_control

-Wattribute-warning#

This diagnostic is enabled by default.

Diagnostic text:

warning: call to ‘A’ declared with ‘warning’ attribute: B

warning: -mtocdata option is ignored for A because B

-Wattributes#

This diagnostic is enabled by default.

Controls -Wignored-attributes, -Wunknown-attributes.

-Wauto-decl-extensions#

Diagnostic text:

warning: type inference of a declaration other than a plain identifier with optional trailing attributes is a Clang extension

-Wauto-disable-vptr-sanitizer#

This diagnostic is enabled by default.

Diagnostic text:

warning: implicitly disabling vptr sanitizer because rtti wasn’t enabled

-Wauto-import#

This diagnostic flag exists for GCC compatibility, and has no effect in Clang.

-Wauto-storage-class#

This diagnostic is enabled by default.

Diagnostic text:

warning: ‘auto’ storage class specifier is not permitted in C++11, and will not be supported in future releases

-Wauto-var-id#

This diagnostic is enabled by default.

Diagnostic text:

warning: ‘auto’ deduced as ‘id’ in declaration of A

-Wavailability#

This diagnostic is enabled by default.

Diagnostic text:

warning: ‘unavailable’ availability overrides all other availability information

warning: Fuchsia API Level prohibits specifying a minor or sub-minor version

warning: ignoring availability attribute 

on ‘+load’ method

with constructor attribute

with destructor attribute

warning: only ‘unavailable’ and ‘deprecated’ are supported for Swift availability

warning: unknown environment A in availability macro

warning: unknown platform A in availability macro

warning: feature cannot be 

introduced

deprecated

obsoleted

 in B version C before it was 

introduced

deprecated

obsoleted

 in version E; attribute ignored

warning: use same version number separators ‘_’ or ‘.’; as in ‘major[.minor[.subminor]]’

warning: availability does not match previous declaration

warning: 

overriding 

method 

introduced after

deprecated before

obsoleted before

 

the protocol method it implements

overridden method

 on B (C vs. D)

warning: 

overriding 

method cannot be unavailable on A when 

the protocol method it implements

its overridden method

 is available

-Wavr-rtlib-linking-quirks#

This diagnostic is enabled by default.

Diagnostic text:

warning: support for linking stdlibs for microcontroller ‘A’ is not implemented

warning: no avr-libc installation can be found on the system, cannot link standard libraries

warning: support for passing the data section address to the linker for microcontroller ‘A’ is not implemented

warning: no target microcontroller specified, please pass -mmcu=<mcu name>

warning: standard library not linked and so no interrupt vector table or compiler runtime routines will be linked

-Wbackend-plugin#

This diagnostic is enabled by default.

Diagnostic text:

The text of this diagnostic is not controlled by Clang.

warning: A (B) exceeds limit (C) in ‘D’

-Wbackslash-newline-escape#

This diagnostic is enabled by default.

Diagnostic text:

warning: backslash and newline separated by space

-Wbad-function-cast#

Diagnostic text:

warning: cast from function call of type A to non-matching type B

-Wbinary-literal#

Controls -Wc++14-binary-literal, -Wc++98-c++11-compat-binary-literal.

-Wbind-to-temporary-copy#

Also controls -Wc++98-compat-bind-to-temporary-copy.

Diagnostic text:

warning: C++98 requires an accessible copy constructor for class C when binding a reference to a temporary; was 

private

protected

warning: no viable constructor 

copying variable

copying parameter

initializing template parameter

returning object

initializing statement expression result

throwing object

copying member subobject

copying array element

allocating object

copying temporary

initializing base subobject

initializing vector element

capturing value

initializing binding

 of type B; C++98 requires a copy constructor when binding a reference to a temporary

-Wbit-int-extension#

Diagnostic text:

warning: ‘_BitInt’ in 

C17 and earlier

C++

 is a Clang extension

warning: ‘_BitInt’ suffix for literals is a Clang extension

-Wbitfield-constant-conversion#

This diagnostic is enabled by default.

Also controls -Wsingle-bit-bitfield-constant-conversion.

Diagnostic text:

warning: implicit truncation from C to bit-field changes value from A to B

-Wbitfield-enum-conversion#

Diagnostic text:

warning: bit-field A is not wide enough to store all enumerators of B

warning: signed bit-field A needs an extra bit to represent the largest positive enumerators of B

warning: assigning value of signed enum type B to unsigned bit-field A; negative enumerators of enum B will be converted to positive values

-Wbitfield-width#

This diagnostic is enabled by default.

Diagnostic text:

warning: width of bit-field A (B bits) exceeds the width of its type; value will be truncated to C bit

s

-Wbitwise-conditional-parentheses#

This diagnostic is enabled by default.

Diagnostic text:

warning: operator ‘?:’ has lower precedence than ‘A’; ‘A’ will be evaluated first

-Wbitwise-instead-of-logical#

Diagnostic text:

warning: use of bitwise ‘A’ with boolean operands

-Wbitwise-op-parentheses#

Diagnostic text:

warning: ‘A’ within ‘B’

-Wblock-capture-autoreleasing#

This diagnostic is enabled by default.

Diagnostic text:

warning: block captures an autoreleasing out-parameter, which may result in use-after-free bugs

-Wbool-conversion#

This diagnostic is enabled by default.

Also controls -Wpointer-bool-conversion, -Wundefined-bool-conversion.

Diagnostic text:

warning: initialization of pointer of type A to null from a constant boolean expression

-Wbool-conversions#

Synonym for -Wbool-conversion.

-Wbool-operation#

Also controls -Wbitwise-instead-of-logical.

Diagnostic text:

warning: bitwise negation of a boolean expression

;

 always evaluates to ‘true’;

 did you mean logical negation?

-Wbounds-safety-counted-by-elt-type-unknown-size#

This diagnostic is enabled by default.

Diagnostic text:

warning: ‘

counted_by

sized_by

counted_by_or_null

sized_by_or_null

‘ 

cannot

should not

 be applied to 

a pointer with pointee

an array with element

 of unknown size because B is 

an incomplete type

a sizeless type

a function type

a struct type with a flexible array member

. This will be an error in a future compiler version

-Wbraced-scalar-init#

This diagnostic is enabled by default.

Diagnostic text:

warning: braces around 

scalar 

initializer

-Wbranch-protection#

This diagnostic is enabled by default.

Diagnostic text:

warning: ‘-mbranch-protection=’ option is incompatible with the ‘A’ architecture

warning: ignoring the ‘branch-protection’ attribute because the ‘A’ architecture does not support it

warning: invalid branch protection option ‘A’ in ‘B’

warning: unsupported branch protection specification ‘A’

-Wbridge-cast#

This diagnostic is enabled by default.

Diagnostic text:

warning: A bridges to B, not C

warning: A cannot bridge to B

-Wbuiltin-assume-aligned-alignment#

This diagnostic is enabled by default.

Diagnostic text:

warning: requested alignment must be A bytes or smaller; maximum alignment assumed

-Wbuiltin-macro-redefined#

This diagnostic is enabled by default.

Diagnostic text:

warning: redefining builtin macro

warning: undefining builtin macro

-Wbuiltin-memcpy-chk-size#

This diagnostic is enabled by default.

Diagnostic text:

warning: ‘A’ will always overflow; destination buffer has size B, but size argument is C

-Wbuiltin-requires-header#

This diagnostic is enabled by default.

Diagnostic text:

warning: declaration of built-in function ‘B’ requires inclusion of the header <A>

-Wc++-compat#

Some of the diagnostics controlled by this flag are enabled by default.

Also controls -Wc++-hidden-decl, -Wc++-keyword, -Wc++-unterminated-string-initialization, -Wdefault-const-init, -Wduplicate-decl-specifier, -Wimplicit-int-enum-cast, -Wimplicit-void-ptr-cast, -Wjump-misses-init, -Wtentative-definition-compat.

Diagnostic text:

warning: if you see this diagnostic, a Clang developer has made a mistake

warning: 

empty 

struct

union

 has size 0 in C, 

size 1

non-zero size

 in C++

-Wc++-hidden-decl#

Diagnostic text:

warning: 

struct

union

enum

 defined within a struct or union is not visible in C++

-Wc++-keyword#

Diagnostic text:

warning: identifier A conflicts with a C++ keyword

-Wc++-unterminated-string-initialization#

Diagnostic text:

warning: initializer-string for character array is too long for C++, array size is A but initializer has size B (including the null terminating character)

-Wc++0x-compat#

Synonym for -Wc++11-compat.

-Wc++0x-extensions#

Synonym for -Wc++11-extensions.

-Wc++0x-narrowing#

Synonym for -Wc++11-narrowing.

-Wc++11-compat#

Some of the diagnostics controlled by this flag are enabled by default.

Also controls -Wc++11-compat-deprecated-writable-strings, -Wc++11-compat-reserved-user-defined-literal, -Wc++11-narrowing, -Wpre-c++14-compat, -Wpre-c++17-compat, -Wpre-c++20-compat, -Wpre-c++23-compat, -Wpre-c++26-compat.

Diagnostic text:

warning: integer literal is too large to be represented in type ‘long’ and is subject to undefined behavior under C++98, interpreting as ‘unsigned long’; this literal will 

have type ‘long long’

be ill-formed

 in C++11 onwards

warning: ‘auto’ storage class specifier is redundant and incompatible with C++11

warning: identifier after literal will be treated as a user-defined literal suffix in C++11

warning: ‘A’ is a keyword in C++11

warning: use of right-shift operator (‘>>’) in template argument will require parentheses in C++11

warning: explicit instantiation cannot be ‘inline’

warning: explicit instantiation of A must occur at global scope

warning: explicit instantiation of A not in a namespace enclosing B

warning: explicit instantiation of A must occur in namespace B

warning: integer literal is too large to be represented in type ‘long’, interpreting as ‘unsigned long’ per C++98; this literal will 

have type ‘long long’

be ill-formed

 in C++11 onwards

-Wc++11-compat-deprecated-writable-strings#

This diagnostic is enabled by default.

Diagnostic text:

warning: conversion from string literal to A is deprecated

-Wc++11-compat-pedantic#

Some of the diagnostics controlled by this flag are enabled by default.

Controls -Wc++11-compat, -Wpre-c++14-compat-pedantic, -Wpre-c++17-compat-pedantic, -Wpre-c++20-compat-pedantic, -Wpre-c++23-compat-pedantic, -Wpre-c++26-compat-pedantic.

-Wc++11-compat-reserved-user-defined-literal#

Diagnostic text:

warning: identifier after literal will be treated as a reserved user-defined literal suffix in C++11

-Wc++11-extensions#

Some of the diagnostics controlled by this flag are enabled by default.

Also controls -Wc++11-extra-semi, -Wc++11-inline-namespace, -Wc++11-long-long.

Diagnostic text:

warning: alias declarations are a C++11 extension

warning: implicit conversion from array size expression of type A to 

integral

enumeration

 type C is a C++11 extension

warning: cast between pointer-to-function and pointer-to-object is a C++11 extension

warning: [[]] attributes are a C++11 extension

warning: enumeration types with a fixed underlying type are a C++11 extension

warning: commas at the end of enumerator lists are a C++11 extension

warning: 

defaulted

deleted

 function definitions are a C++11 extension

warning: empty macro arguments are a C++11 extension

warning: explicit conversion functions are a C++11 extension

warning: extern templates are a C++11 extension

warning: range-based for loop is a C++11 extension

warning: generalized initializer lists are a C++11 extension

warning: inline namespaces are a C++11 extension

warning: non-class friend type A is a C++11 extension

warning: default member initializer for non-static data member is a C++11 extension

warning: ‘A’ keyword is a C++11 extension

warning: reference qualifiers on functions are a C++11 extension

warning: rvalue references are a C++11 extension

warning: scoped enumerations are a C++11 extension

warning: static data member A in union is a C++11 extension

warning: default template arguments for a function template are a C++11 extension

warning: parentheses around address non-type template argument are a C++11 extension

warning: non-type template argument referring to 

function

object

 B with internal linkage is a C++11 extension

warning: use of ‘template’ keyword outside of a template is a C++11 extension

warning: ‘typename’ outside of a template is a C++11 extension

warning: variadic templates are a C++11 extension

warning: ‘auto’ type specifier is a 

C++11

HLSL 202y

 extension

warning: lambdas are a 

C++11

clang HLSL

 extension

warning: use of enumeration in a nested name specifier is a C++11 extension

warning: unelaborated friend declaration is a C++11 extension; specify ‘

struct

interface

union

class

enum

‘ to befriend B

-Wc++11-extra-semi#

Diagnostic text:

warning: extra ‘;’ outside of a function is a C++11 extension

-Wc++11-inline-namespace#

This diagnostic flag exists for GCC compatibility, and has no effect in Clang.

-Wc++11-long-long#

Diagnostic text:

warning: ‘long long’ is a C++11 extension

-Wc++11-narrowing#

Some of the diagnostics controlled by this flag are enabled by default.

Also controls -Wc++11-narrowing-const-reference.

Diagnostic text:

error: 

case value

enumerator value

non-type template argument

non-type parameter of template template parameter

array size

explicit specifier argument

noexcept specifier argument

call to ‘size()’

call to ‘data()’

pack index

 

cannot be narrowed from type C to D

evaluates to C, which cannot be narrowed to type D

error: constant expression evaluates to A which cannot be narrowed to type B

error: type A cannot be narrowed to B in initializer list

error: non-constant-expression cannot be narrowed from type A to B in initializer list

warning: constant expression evaluates to A which cannot be narrowed to type B in C++11

warning: type A cannot be narrowed to B in initializer list in C++11

warning: non-constant-expression cannot be narrowed from type A to B in initializer list in C++11

-Wc++11-narrowing-const-reference#

This diagnostic is an error by default, but the flag -Wno-c++11-narrowing-const-reference can be used to disable the error.

Diagnostic text:

error: constant expression evaluates to A which cannot be narrowed to type B

error: type A cannot be narrowed to B in initializer list

error: non-constant-expression cannot be narrowed from type A to B in initializer list

-Wc++14-attribute-extensions#

Diagnostic text:

warning: use of the A attribute is a C++14 extension

-Wc++14-binary-literal#

Diagnostic text:

warning: binary integer literals are a C++14 extension

-Wc++14-compat#

Some of the diagnostics controlled by this flag are enabled by default.

Controls -Wpre-c++17-compat, -Wpre-c++20-compat, -Wpre-c++23-compat, -Wpre-c++26-compat.

-Wc++14-compat-pedantic#

Some of the diagnostics controlled by this flag are enabled by default.

Controls -Wc++14-compat, -Wpre-c++17-compat-pedantic, -Wpre-c++20-compat-pedantic, -Wpre-c++23-compat-pedantic, -Wpre-c++26-compat-pedantic.

-Wc++14-extensions#

Some of the diagnostics controlled by this flag are enabled by default.

Also controls -Wc++14-attribute-extensions, -Wc++14-binary-literal.

Diagnostic text:

warning: multiple return statements in constexpr function is a C++14 extension

warning: variable declaration in a constexpr 

function

constructor

 is a C++14 extension

warning: type definition in a constexpr 

function

constructor

 is a C++14 extension

warning: use of this statement in a constexpr 

function

constructor

 is a C++14 extension

warning: ‘decltype(auto)’ type specifier is a C++14 extension

warning: initialized lambda captures are a C++14 extension

warning: variable templates are a C++14 extension

-Wc++17-attribute-extensions#

Diagnostic text:

warning: use of the A attribute is a C++17 extension

-Wc++17-compat#

Some of the diagnostics controlled by this flag are enabled by default.

Controls -Wc++17-compat-mangling, -Wdeprecated-increment-bool, -Wdeprecated-register, -Wpre-c++20-compat, -Wpre-c++23-compat, -Wpre-c++26-compat.

-Wc++17-compat-mangling#

This diagnostic is enabled by default.

Diagnostic text:

warning: mangled name of A will change in C++17 due to non-throwing exception specification in function signature

-Wc++17-compat-pedantic#

Some of the diagnostics controlled by this flag are enabled by default.

Controls -Wc++17-compat, -Wpre-c++20-compat-pedantic, -Wpre-c++23-compat-pedantic, -Wpre-c++26-compat-pedantic.

-Wc++17-extensions#

Some of the diagnostics controlled by this flag are enabled by default.

Also controls -Wc++17-attribute-extensions.

Diagnostic text:

warning: constexpr if is a C++17 extension

warning: ‘constexpr’ on lambda expressions is a C++17 extension

warning: ‘static_assert’ with no message is a C++17 extension

warning: structured binding declarations are a C++17 extension

warning: pack fold expression is a C++17 extension

warning: ‘begin’ and ‘end’ returning different types (A and B) is a C++17 extension

warning: hexadecimal floating literals are a C++17 extension

warning: ‘

if

switch

‘ initialization statements are a C++17 extension

warning: inline variables are a C++17 extension

warning: use of multiple declarators in a single using declaration is a C++17 extension

warning: attributes on 

a namespace

an enumerator

 declaration are a C++17 extension

warning: by value capture of ‘*this’ is a C++17 extension

warning: template template parameter using ‘typename’ is a C++17 extension

warning: default scope specifier for attributes is a C++17 extension

warning: pack expansion of using declaration is a C++17 extension

warning: ISO C++ standards before C++17 do not allow new expression for type A to use list-initialization

warning: nested namespace definition is a C++17 extension; define each namespace separately

-Wc++1y-extensions#

Synonym for -Wc++14-extensions.

-Wc++1z-compat#

Synonym for -Wc++17-compat.

-Wc++1z-compat-mangling#

Synonym for -Wc++17-compat-mangling.

-Wc++1z-extensions#

Synonym for -Wc++17-extensions.

-Wc++20-attribute-extensions#

Diagnostic text:

warning: use of the A attribute is a C++20 extension

-Wc++20-compat#

Some of the diagnostics controlled by this flag are enabled by default.

Also controls -Wpre-c++23-compat, -Wpre-c++26-compat.

Diagnostic text:

warning: aggregate initialization of type A with user-declared constructors is incompatible with C++20

warning: this expression will be parsed as explicit(bool) in C++20

warning: explicit initialization of field B will not be enforced in C++20 and later because C has a user-declared constructor, making the type no longer an aggregate

warning: ‘<=>’ is a single token in C++20; add a space to avoid a change in behavior

warning: taking address of non-addressable standard library function is incompatible with C++20

warning: type of UTF-8 string literal will change from array of const char to array of const char8_t in C++20

warning: ‘A’ is a keyword in C++20

-Wc++20-compat-pedantic#

Some of the diagnostics controlled by this flag are enabled by default.

Controls -Wc++20-compat, -Wpre-c++23-compat-pedantic, -Wpre-c++26-compat-pedantic.

-Wc++20-designator#

Diagnostic text:

warning: designated initializers are a C++20 extension

-Wc++20-extensions#

Some of the diagnostics controlled by this flag are enabled by default.

Also controls -Wc++20-attribute-extensions, -Wc++20-designator, -Wvariadic-macro-arguments-omitted.

Diagnostic text:

warning: use of function template name with no prior declaration in function call with explicit template arguments is a C++20 extension

warning: ‘auto’ parameters are a C++20 extension

warning: default member initializer for bit-field is a C++20 extension

warning: captured structured bindings are a C++20 extension

warning: constexpr constructor that does not initialize all members is a C++20 extension

warning: function try block in constexpr 

function

constructor

 is a C++20 extension

warning: uninitialized variable in a constexpr 

function

constructor

 is a C++20 extension

warning: constexpr union constructor that does not initialize any member is a C++20 extension

warning: class template argument deduction for alias templates is a C++20 extension

warning: use of this statement in a constexpr 

function

constructor

 is a C++20 extension

warning: structured binding declaration declared ‘A’ is a C++20 extension

warning: defaulted comparison operators are a C++20 extension

warning: explicit capture of ‘this’ with a capture default of ‘=’ is a C++20 extension

warning: explicit(bool) is a C++20 extension

warning: range-based for loop initialization statements are a C++20 extension

warning: missing ‘typename’ prior to dependent type name A is a C++20 extension

warning: initialized lambda capture packs are a C++20 extension

warning: explicit template parameter list for lambdas is a C++20 extension

warning: using declaration naming a scoped enumerator is a C++20 extension

warning: using enum declaration is a C++20 extension

warning: inline nested namespace definition is a C++20 extension

warning: invoking a pointer to a ‘const &’ member function on an rvalue is a C++20 extension

warning: aggregate initialization of type A from a parenthesized list of values is a C++20 extension

-Wc++23-attribute-extensions#

Diagnostic text:

warning: use of the A attribute is a C++23 extension

-Wc++23-compat#

Synonym for -Wpre-c++26-compat.

-Wc++23-extensions#

This diagnostic is enabled by default.

Also controls -Wc++23-lambda-attributes.

Diagnostic text:

warning: alias declaration in this context is a C++23 extension

warning: ‘auto’ as a functional-style cast is a C++23 extension

warning: consteval if is a C++23 extension

warning: definition of a 

static

thread_local

 variable in a constexpr 

function

constructor

 is a C++23 extension

warning: use of this statement in a constexpr 

function

constructor

 is a C++23 extension

warning: use of a ‘#

<BUG IF SEEN>

elifdef

elifndef

‘ directive is a C++23 extension

warning: label at end of compound statement is a C++23 extension

warning: declaring overloaded A as ‘static’ is a C++23 extension

warning: ‘size_t’ suffix for literals is a C++23 extension

warning: static lambdas are a C++23 extension

warning: lambda without a parameter clause is a C++23 extension

-Wc++23-lambda-attributes#

This diagnostic is enabled by default.

Diagnostic text:

warning: 

an attribute specifier sequence

B

 in this position is a C++23 extension

-Wc++26-extensions#

Some of the diagnostics controlled by this flag are enabled by default.

Diagnostic text:

warning: an attribute specifier sequence attached to a structured binding declaration is a C++2c extension

warning: structured binding packs are a C++2c extension

warning: structured binding declaration in a condition is a C++2c extension

warning: ‘= delete’ with a message is a C++2c extension

warning: pack indexing is a C++2c extension

warning: placeholder variables are a C++2c extension

warning: ‘A’ in a raw string literal delimiter is a C++2c extension

warning: ‘static_assert’ with a user-generated message is a C++2c extension

warning: variadic ‘friend’ declarations are a C++2c extension

-Wc++2a-compat#

Synonym for -Wc++20-compat.

-Wc++2a-compat-pedantic#

Synonym for -Wc++20-compat-pedantic.

-Wc++2a-extensions#

Synonym for -Wc++20-extensions.

-Wc++2b-extensions#

Synonym for -Wc++23-extensions.

-Wc++2c-compat#

Synonym for -Wdelete-incomplete.

-Wc++2c-extensions#

Synonym for -Wc++26-extensions.

-Wc++2d-extensions#

This diagnostic is enabled by default.

Diagnostic text:

warning: mathematical notation character A in an identifier is a C++2d extension

warning: pack indexing for template names is a C++2d extension

-Wc++98-c++11-c++14-c++17-compat#

Synonym for -Wpre-c++20-compat.

-Wc++98-c++11-c++14-c++17-compat-pedantic#

Synonym for -Wpre-c++20-compat-pedantic.

-Wc++98-c++11-c++14-compat#

Synonym for -Wpre-c++17-compat.

-Wc++98-c++11-c++14-compat-pedantic#

Synonym for -Wpre-c++17-compat-pedantic.

-Wc++98-c++11-compat#

Synonym for -Wpre-c++14-compat.

-Wc++98-c++11-compat-binary-literal#

Diagnostic text:

warning: binary integer literals are incompatible with C++ standards before C++14

-Wc++98-c++11-compat-pedantic#

Synonym for -Wpre-c++14-compat-pedantic.

-Wc++98-compat#

Some of the diagnostics controlled by this flag are enabled by default.

Also controls -Wc++98-compat-local-type-template-args, -Wc++98-compat-unnamed-type-template-args, -Wpre-c++14-compat, -Wpre-c++17-compat, -Wpre-c++20-compat, -Wpre-c++23-compat, -Wpre-c++26-compat.

Diagnostic text:

warning: alias declarations are incompatible with C++98

warning: 

defaulted

deleted

 function definitions are incompatible with C++98

warning: explicit conversion functions are incompatible with C++98

warning: range-based for loop is incompatible with C++98

warning: generalized initializer lists are incompatible with C++98

warning: inline namespaces are incompatible with C++98

warning: non-class friend type A is incompatible with C++98

warning: default member initializer for non-static data member is incompatible with C++98

warning: ‘A’ keyword is incompatible with C++98

warning: reference qualifiers on functions are incompatible with C++98

warning: rvalue references are incompatible with C++98

warning: scoped enumerations are incompatible with C++98

warning: static data member A in union is incompatible with C++98

warning: default template arguments for a function template are incompatible with C++98

warning: parentheses around address non-type template argument are incompatible with C++98

warning: non-type template argument referring to 

function

object

 B with internal linkage is incompatible with C++98

warning: use of ‘template’ keyword outside of a template is incompatible with C++98

warning: ‘typename’ outside of a template is incompatible with C++98

warning: variadic templates are incompatible with C++98

warning: ‘alignas’ is incompatible with C++98

warning: alignof expressions are incompatible with C++98

warning: ‘auto’ type specifier is incompatible with C++98

warning: ‘constexpr’ specifier is incompatible with C++98

warning: constructor call from initializer list is incompatible with C++98

warning: ‘decltype’ type specifier is incompatible with C++98

warning: delegating constructors are incompatible with C++98

warning: scalar initialized from empty initializer list is incompatible with C++98

warning: initializing A from an empty initializer list is incompatible with C++98

warning: enumeration type in nested name specifier is incompatible with C++98

warning: friend declaration naming a member of the declaring class is incompatible with C++98

warning: jump from this goto statement to its label is incompatible with C++98

warning: jump from this 

indirect

asm

 goto statement to one of its possible targets is incompatible with C++98

warning: initialization of initializer_list object is incompatible with C++98

warning: lambda expressions are incompatible with C++98

warning: ‘<::’ is treated as digraph ‘<:’ (aka ‘[’) followed by ‘:’ in C++98

warning: literal operators are incompatible with C++98

warning: universal character name referring to a control character is incompatible with C++98

warning: specifying character ‘A’ with a universal character name is incompatible with C++98

warning: noexcept specifications are incompatible with C++98

warning: noexcept expressions are incompatible with C++98

warning: use of non-static data member A in an unevaluated context is incompatible with C++98

warning: 

anonymous struct

union

 member B with a non-trivial 

default constructor

copy constructor

move constructor

copy assignment operator

move assignment operator

destructor

 is incompatible with C++98

warning: ‘nullptr’ is incompatible with C++98

warning: passing object of trivial but non-POD type A through variadic 

function

block

method

constructor

 is incompatible with C++98

warning: raw string literals are incompatible with C++98

warning: reference initialized from initializer list is incompatible with C++98

warning: substitution failure due to access control is incompatible with C++98

warning: ‘static_assert’ declarations are incompatible with C++98

warning: jump from switch statement to this case label is incompatible with C++98

warning: use of null pointer as non-type template argument is incompatible with C++98

warning: trailing return types are incompatible with C++98

warning: consecutive right angle brackets are incompatible with C++98 (use ‘> >’)

warning: befriending B without ‘

struct

interface

union

class

enum

‘ keyword is incompatible with C++98

warning: unicode literals are incompatible with C++98

warning: ‘A’ type specifier is incompatible with C++98

warning: inheriting constructors are incompatible with C++98

-Wc++98-compat-bind-to-temporary-copy#

Diagnostic text:

warning: 

copying variable

copying parameter

initializing template parameter

returning object

initializing statement expression result

throwing object

copying member subobject

copying array element

allocating object

copying temporary

initializing base subobject

initializing vector element

capturing value

initializing binding

 of type C when binding a reference to a temporary would 

invoke an inaccessible constructor

find no viable constructor

find ambiguous constructors

invoke a deleted constructor

 in C++98

-Wc++98-compat-extra-semi#

Diagnostic text:

warning: extra ‘;’ outside of a function is incompatible with C++98

-Wc++98-compat-local-type-template-args#

Diagnostic text:

warning: local type A as template argument is incompatible with C++98

-Wc++98-compat-pedantic#

Some of the diagnostics controlled by this flag are enabled by default.

Also controls -Wc++98-compat, -Wc++98-compat-bind-to-temporary-copy, -Wc++98-compat-extra-semi, -Wpre-c++14-compat-pedantic, -Wpre-c++17-compat-pedantic, -Wpre-c++20-compat-pedantic, -Wpre-c++23-compat-pedantic, -Wpre-c++26-compat-pedantic.

Diagnostic text:

warning: implicit conversion from array size expression of type A to 

integral

enumeration

 type C is incompatible with C++98

warning: cast between pointer-to-function and pointer-to-object is incompatible with C++98

warning: [[]] attributes are incompatible with C++98

warning: enumeration types with a fixed underlying type are incompatible with C++98

warning: commas at the end of enumerator lists are incompatible with C++98

warning: empty macro arguments are incompatible with C++98

warning: extern templates are incompatible with C++98

warning: ‘long long’ is incompatible with C++98

warning: #line number greater than 32767 is incompatible with C++98

warning: variadic macros are incompatible with C++98

-Wc++98-compat-unnamed-type-template-args#

Diagnostic text:

warning: unnamed type as template argument is incompatible with C++98

-Wc-attribute-extension#

This diagnostic is enabled by default.

Diagnostic text:

warning: ISO C does not allow an attribute list to appear here

-Wc11-extensions#

Diagnostic text:

warning: anonymous unions are a C11 extension

warning: anonymous structs are a C11 extension

warning: ‘A’ is a C11 extension

warning: pointer comparisons before C11 need to be between two complete or two incomplete types; A is 

in

complete and B is 

in

complete

-Wc23-compat#

Diagnostic text:

warning: type of UTF-8 string literal will change from array of char to array of char8_t in C23

warning: ‘A’ is a keyword in C23

-Wc23-extensions#

Some of the diagnostics controlled by this flag are enabled by default.

Also controls -Wvariadic-macro-arguments-omitted.

Diagnostic text:

warning: [[]] attributes are a C23 extension

warning: use of a ‘#

<BUG IF SEEN>

elifdef

elifndef

‘ directive is a C23 extension

warning: enumeration types with a fixed underlying type are a C23 extension

warning: label at end of compound statement is a C23 extension

warning: ‘_Static_assert’ with no message is a C23 extension

warning: label followed by a declaration is a C23 extension

warning: declaration of non-local variable in ‘for’ loop is a C23 extension

warning: non-variable declaration in ‘for’ loop is a C23 extension

warning: ‘restrict’ qualifier on an array of pointers is a C23 extension

warning: binary integer literals are a C23 extension

warning: ‘_BitInt’ suffix for literals is a C23 extension

warning: 

incremented 

enumerator value which exceeds the range of ‘int’ is a C23 extension (B is too 

small

large

)

warning: use of an empty initializer is a C23 extension

warning: ‘nullptr’ is a C23 extension

warning: omitting the parameter name in a function definition is a C23 extension

warning: #embed is a 

C23

Clang

 extension

warning: defining a type within ‘

__builtin_offsetof

offsetof

‘ is a C23 extension

-Wc2x-compat#

Synonym for -Wc23-compat.

-Wc2x-extensions#

Synonym for -Wc23-extensions.

-Wc2y-extensions#

Some of the diagnostics controlled by this flag are enabled by default.

Also controls -Wcounter-extension, -Wstatic-in-inline.

Diagnostic text:

warning: ‘alignof’ on an incomplete array type is a C2y extension

warning: use of incomplete type A in a ‘_Generic’ association is a C2y extension

warning: ‘

if

switch

‘ declaration statements are a C2y extension

warning: passing a type argument as the first operand to ‘_Generic’ is a C2y extension

warning: imaginary constants are a C2y extension

warning: ‘

–

++

‘ on an object of complex type is a C2y extension

warning: case ranges are a C2y extension

warning: ‘A’ is a C2y extension

warning: octal integer literals are a C2y extension

-Wc99-compat#

Some of the diagnostics controlled by this flag are enabled by default.

Diagnostic text:

warning: 

using this character in an identifier

starting an identifier with this character

 is incompatible with C99

warning: unicode literals are incompatible with C99

warning: ‘A’ is a keyword in C99

warning: integer literal is too large to be represented in type ‘long’, interpreting as ‘unsigned long’ per C89; this literal will 

have type ‘long long’

be ill-formed

 in C99 onwards

-Wc99-designator#

Some of the diagnostics controlled by this flag are enabled by default.

Also controls -Wc++20-designator, -Winitializer-overrides, -Wreorder-init-list.

Diagnostic text:

warning: designated initializers are a C99 feature

warning: array designators are a C99 extension

warning: brace elision for designated initializer is a C99 extension

warning: mixture of designated and non-designated initializers in the same initializer list is a C99 extension

warning: nested designators are a C99 extension

-Wc99-extensions#

Some of the diagnostics controlled by this flag are enabled by default.

Also controls -Wc99-designator.

Diagnostic text:

warning: initializer for aggregate is not a compile-time constant

warning: 

qualifier in 

static 

array size 

‘[*] ‘

is a C99 feature

warning: compound literals are a C99-specific feature

warning: ‘A’ is a C99 extension

warning: flexible array members are a C99 feature

warning: variable declaration in for loop is a C99-specific feature

warning: ISO C99 requires whitespace after the macro name

warning: empty macro arguments are a C99 feature

warning: commas at the end of enumerator lists are a C99-specific feature

warning: hexadecimal floating constants are a C99 feature

-Wcall-graph-section-no-prototype#

This diagnostic is enabled by default.

Diagnostic text:

warning: indirect call to a function with no prototype; generating type metadata for assumed prototype A (type string: B)

-Wcall-to-pure-virtual-from-ctor-dtor#

This diagnostic is enabled by default.

Diagnostic text:

warning: call to pure virtual member function A has undefined behavior; overrides of A in subclasses are not available in the 

constructor

destructor

 of C

-Wcalled-once-parameter#

Some of the diagnostics controlled by this flag are enabled by default.

Also controls -Wcompletion-handler.

Diagnostic text:

warning: A parameter marked ‘called_once’ is called twice

warning: 

captured 

A parameter marked ‘called_once’ is never called

warning: A parameter marked ‘called_once’ is never 

used

called

 when 

taking true branch

taking false branch

handling this case

none of the cases applies

entering the loop

skipping the loop

taking one of the branches

-Wcast-align#

Diagnostic text:

warning: cast from A to B increases required alignment from C to D

-Wcast-calling-convention#

This diagnostic is enabled by default.

Diagnostic text:

warning: cast between incompatible calling conventions ‘A’ and ‘B’; calls through this pointer may abort at runtime

-Wcast-function-type#

Controls -Wcast-function-type-mismatch, -Wcast-function-type-strict.

-Wcast-function-type-mismatch#

Diagnostic text:

warning: cast 

from A to B 

converts to incompatible function type

-Wcast-function-type-strict#

Diagnostic text:

warning: cast 

from A to B 

converts to incompatible function type

-Wcast-of-sel-type#

This diagnostic is enabled by default.

Diagnostic text:

warning: cast of type A to B is deprecated; use sel_getName instead

-Wcast-qual#

Diagnostic text:

warning: cast from A to B drops 

const and volatile qualifiers

const qualifier

volatile qualifier

warning: cast from A to B must have all intermediate pointers const qualified to be safe

-Wcast-qual-unrelated#

This diagnostic is enabled by default.

Diagnostic text:

warning: ISO C++ does not allow 

const_cast

static_cast

reinterpret_cast

dynamic_cast

C-style cast

functional-style cast

 from B to C because it casts away qualifiers, even though the source and destination types are unrelated

-Wcfi-unchecked-callee#

This diagnostic is enabled by default.

Diagnostic text:

warning: implicit conversion from A to B discards ‘cfi_unchecked_callee’ attribute

-Wchar-align#

This diagnostic flag exists for GCC compatibility, and has no effect in Clang.

-Wchar-subscripts#

Diagnostic text:

warning: array section 

lower bound

length

 is of type ‘char’

warning: array subscript is of type ‘char’

-Wcharacter-conversion#

This diagnostic is enabled by default.

Diagnostic text:

warning: 

arithmetic between

bitwise operation between

comparison of

conditional expression between

compound assignment of

 different Unicode character types B and C

warning: comparing values of different Unicode code unit types A and B may compare different code points

warning: comparing values of different Unicode code unit types A and B compares unrelated code units C and D

warning: implicit conversion from A to B may change the meaning of the represented code unit

warning: implicit conversion from A to B changes the meaning of the 

code unit

code point

 D

warning: implicit conversion from A to B may lose precision and change the meaning of the represented code unit

-Wclang-cl-pch#

This diagnostic is enabled by default.

Diagnostic text:

warning: support for ‘/Yc’ with more than one source file not implemented yet; flag ignored

warning: support for ‘/Yc’ and ‘/Yu’ with different filenames not implemented yet; flags ignored

warning: #pragma hdrstop filename not supported, /Fp can be used to specify precompiled header filename

warning: definition of macro A does not match definition in precompiled header

-Wclangir#

This diagnostic is enabled by default.

Diagnostic text:

The text of this diagnostic is not controlled by Clang.

-Wclass-conversion#

This diagnostic is enabled by default.

Diagnostic text:

warning: conversion function converting A to its base class B will never be used

warning: conversion function converting A to itself will never be used

warning: conversion function converting A to B will never be used

-Wclass-varargs#

Some of the diagnostics controlled by this flag are enabled by default.

Also controls -Wnon-pod-varargs.

Diagnostic text:

warning: passing object of class type A through variadic 

function

block

method

constructor

; did you mean to call ‘D’?

-Wcmse-union-leak#

This diagnostic is enabled by default.

Diagnostic text:

warning: passing union across security boundary via 

parameter B

return value

 may leak information

-Wcomma#

Diagnostic text:

warning: possible misuse of comma operator here

-Wcomment#

Some of the diagnostics controlled by this flag are enabled by default.

Diagnostic text:

warning: escaped newline between */ characters at block comment end

warning: // comments are not allowed in this language

warning: multi-line // comment

warning: ‘/*’ within block comment

-Wcomments#

Synonym for -Wcomment.

-Wcompare-distinct-pointer-types#

This diagnostic is enabled by default.

Diagnostic text:

warning: comparison of distinct pointer types

 (A and B)

-Wcompletion-handler#

Diagnostic text:

warning: completion handler is called twice

warning: 

captured 

completion handler is never called

warning: completion handler is never 

used

called

 when 

taking true branch

taking false branch

handling this case

none of the cases applies

entering the loop

skipping the loop

taking one of the branches

-Wcomplex-component-init#

Diagnostic text:

warning: complex initialization specifying real and imaginary components is an extension

-Wcompound-token-split#

Some of the diagnostics controlled by this flag are enabled by default.

Controls -Wcompound-token-split-by-macro, -Wcompound-token-split-by-space.

-Wcompound-token-split-by-macro#

This diagnostic is enabled by default.

Diagnostic text:

warning: 

B and 

C tokens 

introducing statement expression

terminating statement expression

introducing attribute

terminating attribute

forming pointer to member type

 appear in different macro expansion contexts

-Wcompound-token-split-by-space#

Diagnostic text:

warning: 

B and 

C tokens 

introducing statement expression

terminating statement expression

introducing attribute

terminating attribute

forming pointer to member type

 are separated by whitespace

-Wconditional-type-mismatch#

This diagnostic is enabled by default.

Diagnostic text:

warning: pointer/integer type mismatch in conditional expression

 (A and B)

-Wconditional-uninitialized#

Diagnostic text:

warning: variable A may be uninitialized when 

used here

captured by block

-Wconfig-macros#

This diagnostic is enabled by default.

Diagnostic text:

warning: 

definition

#undef

 of configuration macro ‘B’ has no effect on the import of ‘C’; pass ‘

-DB=…

-UB

‘ on the command line to configure the module

-Wconstant-conversion#

This diagnostic is enabled by default.

Also controls -Wbitfield-constant-conversion, -Wobjc-bool-constant-conversion.

Diagnostic text:

warning: implicit conversion from C to D changes value from A to B

-Wconstant-evaluated#

This diagnostic is enabled by default.

Diagnostic text:

warning: ‘A’ will always evaluate to ‘true’ in a manifestly constant-evaluated expression

-Wconstant-logical-operand#

This diagnostic is enabled by default.

Diagnostic text:

warning: use of logical ‘A’ with constant operand

-Wconstexpr-not-const#

This diagnostic is enabled by default.

Diagnostic text:

warning: ‘constexpr’ non-static member function will not be implicitly ‘const’ in C++14; add ‘const’ to avoid a change in behavior

-Wconsumed#

Diagnostic text:

warning: consumed analysis attribute is attached to member of class A which isn’t marked as consumable

warning: state of variable ‘A’ must match at the entry and exit of loop

warning: parameter ‘A’ not in expected state when the function returns: expected ‘B’, observed ‘C’

warning: argument not in expected state; expected ‘A’, observed ‘B’

warning: return state set for an unconsumable type ‘A’

warning: return value not in expected state; expected ‘A’, observed ‘B’

warning: invalid invocation of method ‘A’ on object ‘B’ while it is in the ‘C’ state

warning: invalid invocation of method ‘A’ on a temporary object while it is in the ‘B’ state

-Wconversion#

Some of the diagnostics controlled by this flag are enabled by default.

Also controls -Wbitfield-enum-conversion, -Wbool-conversion, -Wcharacter-conversion, -Wconstant-conversion, -Wenum-conversion, -Wfloat-conversion, -Wimplicit-float-conversion, -Wimplicit-int-conversion, -Wint-conversion, -Wliteral-conversion, -Wnon-literal-null-conversion, -Wnull-conversion, -Wobjc-literal-conversion, -Woverflow-behavior-conversion, -Wsign-conversion, -Wstring-conversion.

Diagnostic text:

warning: implicit conversion discards imaginary component: A to B

warning: implicit conversion turns vector to scalar: A to B

warning: passing non-generic address space pointer to A may cause dynamic conversion affecting performance

warning: non-type template argument with value ‘A’ converted to ‘B’ for unsigned template parameter of type C

warning: non-type template argument value ‘A’ truncated to ‘B’ for template parameter of type C

-Wconversion-null#

Synonym for -Wnull-conversion.

-Wcoro-non-aligned-allocation-function#

This diagnostic is enabled by default.

Diagnostic text:

warning: under -fcoro-aligned-allocation, the non-aligned allocation function for the promise type A has higher precedence than the global aligned allocation function

-Wcoro-type-aware-allocation-function#

This diagnostic is enabled by default.

Diagnostic text:

warning: type aware A will not be used for coroutine allocation

-Wcoroutine#

This diagnostic is enabled by default.

Also controls -Walways-inline-coroutine, -Wcoro-non-aligned-allocation-function, -Wcoro-type-aware-allocation-function, -Wcoroutine-missing-unhandled-exception, -Wdeprecated-coroutine.

Diagnostic text:

warning: return type of ‘coroutine_handle<>::address should be ‘void*’ (have A) in order to get capability with existing async C API

-Wcoroutine-missing-unhandled-exception#

This diagnostic is enabled by default.

Diagnostic text:

warning: A is required to declare the member ‘unhandled_exception()’ when exceptions are enabled

-Wcoroutines-unsupported-target#

This diagnostic is enabled by default.

Diagnostic text:

warning: coroutines are not currently supported on the 32-bit x86 Microsoft ABI

-Wcounter-extension#

Diagnostic text:

warning: ‘__COUNTER__’ is a C2y extension

-Wcovered-switch-default#

Diagnostic text:

warning: default label in switch which covers all enumeration values

-Wcpp#

Synonym for -W#warnings.

-Wcstring-format-directive#

Diagnostic text:

warning: using A directive in 

NSString

CFString

 which is being passed as a formatting argument to the formatting 

method

CFfunction

-Wctad-maybe-unsupported#

Diagnostic text:

warning: A may not intend to support class template argument deduction

-Wctor-dtor-privacy#

This diagnostic flag exists for GCC compatibility, and has no effect in Clang.

-Wctu#

This diagnostic is enabled by default.

Diagnostic text:

warning: import of an external symbol for CTU failed: A

warning: imported AST from ‘A’ had been generated for a different language, current: B, imported: C

warning: imported AST from ‘A’ had been generated for a different target, current: B, imported: C

warning: invocation for ‘A’ is missing in the invocation list

warning: multiple invocations for ‘A’ are found in the invocation list

-Rctu-remarks#

Diagnostic text:

remark: reached a the CTU-import threshold before trying to import definition

-Wcuda-compat#

Some of the diagnostics controlled by this flag are enabled by default.

Diagnostic text:

warning: A attribute parameter B is negative and will be ignored

warning: nvcc does not allow ‘__A__’ to appear after the parameter list in lambdas

warning: ignored ‘inline’ attribute on kernel function A

warning: kernel function A is a member function; this may not be accepted by nvcc

warning: argument to ‘#pragma unroll’ should not be in parentheses in CUDA C/C++

-Wcustom-atomic-properties#

Diagnostic text:

warning: atomic by default property A has a user defined 

getter

setter

 (property should be marked ‘atomic’ if this is intended)

-Wcxx-attribute-extension#

This diagnostic is enabled by default.

Diagnostic text:

warning: ISO C++ does not allow 

an attribute list

A

 to appear here

-Wdangling#

This diagnostic is enabled by default.

Also controls -Wdangling-assignment, -Wdangling-assignment-gsl, -Wdangling-capture, -Wdangling-field, -Wdangling-gsl, -Wdangling-initializer-list, -Wreturn-stack-address.

Diagnostic text:

warning: 

temporary 

whose address is used as value of

implicitly 

bound to

 

reference 

member of local variable

local 

variable

reference

array backing 

initializer list subobject of local variable

local initializer list

 

D 

will be destroyed at the end of the full-expression

-Wdangling-assignment#

This diagnostic is enabled by default.

Diagnostic text:

warning: object backing 

the pointer 

B will be destroyed at the end of the full-expression

-Wdangling-assignment-gsl#

This diagnostic is enabled by default.

Diagnostic text:

warning: object backing the pointer A will be destroyed at the end of the full-expression

-Wdangling-capture#

This diagnostic is enabled by default.

Diagnostic text:

warning: object whose reference is captured by A will be destroyed at the end of the full-expression

warning: object whose reference is captured will be destroyed at the end of the full-expression

-Wdangling-else#

This diagnostic is enabled by default.

Diagnostic text:

warning: add explicit braces to avoid dangling else

-Wdangling-field#

This diagnostic is enabled by default.

Diagnostic text:

warning: binding reference member A to stack allocated 

variable

parameter

 B

warning: 

reference

backing array for ‘std::initializer_list’

 

subobject of 

member A 

binds to

is

 a temporary object whose lifetime is shorter than the lifetime of the constructed object

warning: initializing pointer member A with the stack address of 

variable

parameter

 B

warning: temporary bound to reference member of allocated object will be destroyed at the end of the full-expression

-Wdangling-gsl#

This diagnostic is enabled by default.

Diagnostic text:

warning: object backing the pointer will be destroyed at the end of the full-expression

warning: initializing pointer member A to point to a temporary object whose lifetime is shorter than the lifetime of the constructed object

-Wdangling-initializer-list#

This diagnostic is enabled by default.

Diagnostic text:

warning: array backing 

initializer list subobject of the allocated object

the allocated initializer list

 will be destroyed at the end of the full-expression

-Wdarwin-sdk-settings#

This diagnostic is enabled by default.

Diagnostic text:

warning: SDK settings were ignored as ‘SDKSettings.json’ could not be parsed

-Wdate-time#

Diagnostic text:

warning: expansion of date or time macro is not reproducible

-Wdealloc-in-category#

This diagnostic is enabled by default.

Diagnostic text:

warning: -dealloc is being overridden in a category

-Wdebug-compression-unavailable#

This diagnostic is enabled by default.

Diagnostic text:

warning: cannot compress debug sections (A not enabled)

-Wdeclaration-after-statement#

Diagnostic text:

warning: mixing declarations and code is a C99 extension

warning: mixing declarations and code is incompatible with standards before C99

-Wdecls-in-multiple-modules#

Diagnostic text:

warning: declaration A is detected to be defined in multiple module units, first is from ‘B’ and second is from ‘C’; the compiler may not be good at merging the definitions. 

-Wdefault-const-init#

Some of the diagnostics controlled by this flag are enabled by default.

Controls -Wdefault-const-init-field, -Wdefault-const-init-unsafe, -Wdefault-const-init-var.

-Wdefault-const-init-field#

Diagnostic text:

warning: default initialization of an object of type A with const member is incompatible with C++

-Wdefault-const-init-field-unsafe#

This diagnostic is enabled by default.

Diagnostic text:

warning: default initialization of an object of type A with const member leaves the object uninitialized

 and is incompatible with C++

-Wdefault-const-init-unsafe#

This diagnostic is enabled by default.

Controls -Wdefault-const-init-field-unsafe, -Wdefault-const-init-var-unsafe.

-Wdefault-const-init-var#

Diagnostic text:

warning: default initialization of an object of type A is incompatible with C++

-Wdefault-const-init-var-unsafe#

This diagnostic is enabled by default.

Diagnostic text:

warning: default initialization of an object of type A leaves the object uninitialized

 and is incompatible with C++

-Wdefaulted-function-deleted#

This diagnostic is enabled by default.

Diagnostic text:

warning: explicitly defaulted 

<ERROR>

equality

three-way

equality

relational

 comparison operator is implicitly deleted

warning: explicitly defaulted 

default constructor

copy constructor

move constructor

copy assignment operator

move assignment operator

destructor

 is implicitly deleted

-Wdelayed-template-parsing-in-cxx20#

This diagnostic is enabled by default.

Diagnostic text:

warning: -fdelayed-template-parsing is deprecated after C++20

-Wdelegating-ctor-cycles#

This diagnostic is an error by default, but the flag -Wno-delegating-ctor-cycles can be used to disable the error.

Diagnostic text:

error: constructor for A creates a delegation cycle

-Wdelete-abstract-non-virtual-dtor#

This diagnostic is enabled by default.

Diagnostic text:

warning: 

delete

destructor

 called on B that is abstract but has non-virtual destructor

-Wdelete-incomplete#

This diagnostic is enabled by default.

Diagnostic text:

warning: cannot delete expression with pointer-to-‘void’ type A

warning: deleting pointer to incomplete type A is incompatible with C++2c and may cause undefined behavior

-Wdelete-non-abstract-non-virtual-dtor#

Diagnostic text:

warning: 

delete

destructor

 called on non-final B that has virtual functions but non-virtual destructor

-Wdelete-non-virtual-dtor#

Some of the diagnostics controlled by this flag are enabled by default.

Controls -Wdelete-abstract-non-virtual-dtor, -Wdelete-non-abstract-non-virtual-dtor.

-Wdelimited-escape-sequence-extension#

Diagnostic text:

warning: 

delimited

named

 escape sequences are a 

C++23

C2y

Clang

 extension

-Wdeprecate-lax-vec-conv-all#

This diagnostic is enabled by default.

Diagnostic text:

warning: implicit conversion between vector types (’A’ and ‘B’) is deprecated; in the future, the behavior implied by ‘-fno-lax-vector-conversions’ will be the default

-Wdeprecated#

Some of the diagnostics controlled by this flag are enabled by default.

Also controls -Wdeprecated-anon-enum-enum-conversion, -Wdeprecated-array-compare, -Wdeprecated-attributes, -Wdeprecated-builtins, -Wdeprecated-comma-subscript, -Wdeprecated-copy, -Wdeprecated-copy-with-dtor, -Wdeprecated-declarations, -Wdeprecated-dynamic-exception-spec, -Wdeprecated-enum-compare, -Wdeprecated-enum-compare-conditional, -Wdeprecated-enum-enum-conversion, -Wdeprecated-enum-float-conversion, -Wdeprecated-increment-bool, -Wdeprecated-literal-operator, -Wdeprecated-missing-comma-variadic-parameter, -Wdeprecated-octal-literals, -Wdeprecated-ofast, -Wdeprecated-pragma, -Wdeprecated-redundant-constexpr-static-def, -Wdeprecated-register, -Wdeprecated-this-capture, -Wdeprecated-type, -Wdeprecated-volatile, -Wdeprecated-writable-strings.

Diagnostic text:

warning: -O4 is equivalent to -O3

warning: access declarations are deprecated; use using declarations instead

warning: argument ‘A’ is deprecated

, use ‘C’ instead

warning: argument ‘A’ is deprecated, B

warning: treating ‘A’ input as ‘B’ when in C++ mode, this behavior is deprecated

warning: ‘default’ clause for ‘metadirective’ is deprecated; use ‘otherwise’ instead

warning: ‘depend’ clause for ‘ordered’ is deprecated; use ‘doacross’ instead

warning: the delimited form of ‘#pragma omp declare target’ without clauses is deprecated; use ‘#pragma omp begin declare target’ instead

warning: minus(-) operator for reductions is deprecated; use + or user defined reduction instead

warning: A does not support the option ‘B’

warning: use of ‘long’ with ‘__vector’ is deprecated

-Wdeprecated-altivec-src-compat#

This diagnostic is enabled by default.

Diagnostic text:

warning: current handling of vector bool and vector pixel types in this context are deprecated; the default behaviour will soon change to that implied by the ‘-altivec-compat=xl’ option

-Wdeprecated-anon-enum-enum-conversion#

This diagnostic is enabled by default.

Diagnostic text:

warning: 

arithmetic between

bitwise operation between

comparison of

conditional expression between

compound assignment of

 different enumeration types

 (B and C)

 is deprecated

-Wdeprecated-array-compare#

This diagnostic is enabled by default.

Diagnostic text:

warning: comparison between two arrays is deprecated; to compare array addresses, use unary ‘+’ to decay operands to pointers

-Wdeprecated-attributes#

This diagnostic is enabled by default.

Diagnostic text:

warning: use of CUDA/HIP target attributes on deduction guides is deprecated; they will be rejected in a future version of Clang

warning: ‘A’ attribute is deprecated and may be removed in a future version of Clang

warning: ‘lifetime_capture_by(A)’ is deprecated; use ‘B’ instead

warning: the ‘[[_Noreturn]]’ attribute spelling is deprecated in C23; use ‘[[noreturn]]’ instead

warning: applying attribute A to a declaration is deprecated; apply it to the type instead

warning: specifying vector types with the ‘mode’ attribute is deprecated; use the ‘vector_size’ attribute instead

-Wdeprecated-builtins#

This diagnostic is enabled by default.

Diagnostic text:

warning: builtin A is deprecated; use B instead

warning: builtin A is deprecated

-Wdeprecated-comma-subscript#

This diagnostic is enabled by default.

Diagnostic text:

warning: top-level comma expression in array subscript is deprecated in C++20 and unsupported in C++23

-Wdeprecated-copy#

Also controls -Wdeprecated-copy-with-user-provided-copy.

Diagnostic text:

warning: definition of implicit copy 

constructor

assignment operator

 for A is deprecated because it has a user-declared copy 

assignment operator

constructor

-Wdeprecated-copy-dtor#

Synonym for -Wdeprecated-copy-with-dtor.

-Wdeprecated-copy-with-dtor#

Also controls -Wdeprecated-copy-with-user-provided-dtor.

Diagnostic text:

warning: definition of implicit copy 

constructor

assignment operator

 for A is deprecated because it has a user-declared destructor

-Wdeprecated-copy-with-user-provided-copy#

Diagnostic text:

warning: definition of implicit copy 

constructor

assignment operator

 for A is deprecated because it has a user-provided copy 

assignment operator

constructor

-Wdeprecated-copy-with-user-provided-dtor#

Diagnostic text:

warning: definition of implicit copy 

constructor

assignment operator

 for A is deprecated because it has a user-provided destructor

-Wdeprecated-coroutine#

This diagnostic is enabled by default.

Diagnostic text:

warning: ‘for co_await’ belongs to CoroutineTS instead of C++20, which is deprecated

-Wdeprecated-declarations#

This diagnostic is enabled by default.

Also controls -Wdeprecated-declarations-switch-case.

Diagnostic text:

warning: the A attribute is deprecated; use ‘amdgpu_waves_per_eu’ instead

warning: specifying ‘uuid’ as an ATL attribute is deprecated; use __declspec instead

warning: use of C-style parameters in Objective-C method declarations is deprecated

warning: A is deprecated

warning: A may be deprecated because the receiver type is unknown

warning: A is deprecated: B

warning: property access is using A method which is deprecated

-Wdeprecated-declarations-switch-case#

This diagnostic is enabled by default.

Diagnostic text:

warning: A is deprecated

-Wdeprecated-dynamic-exception-spec#

Diagnostic text:

warning: dynamic exception specifications are deprecated

-Wdeprecated-enum-compare#

This diagnostic is enabled by default.

Diagnostic text:

warning: 

arithmetic between

bitwise operation between

comparison of

conditional expression between

compound assignment of

 different enumeration types

 (B and C)

 is deprecated

-Wdeprecated-enum-compare-conditional#

This diagnostic is enabled by default.

Diagnostic text:

warning: 

arithmetic between

bitwise operation between

comparison of

conditional expression between

compound assignment of

 different enumeration types

 (B and C)

 is deprecated

-Wdeprecated-enum-enum-conversion#

This diagnostic is enabled by default.

Diagnostic text:

warning: 

arithmetic between

bitwise operation between

comparison of

conditional expression between

compound assignment of

 different enumeration types

 (B and C)

 is deprecated

-Wdeprecated-enum-float-conversion#

This diagnostic is enabled by default.

Diagnostic text:

warning: 

arithmetic between

bitwise operation between

comparison of

conditional expression between

compound assignment of

 

floating-point

enumeration

 type C 

with

from

and

 

enumeration

floating-point

 type D is deprecated

-Wdeprecated-implementations#

Diagnostic text:

warning: implementing deprecated 

method

class

category

warning: implementing unavailable method

-Wdeprecated-increment-bool#

This diagnostic is enabled by default.

Diagnostic text:

warning: incrementing expression of type bool is deprecated and incompatible with C++17

-Wdeprecated-literal-operator#

This diagnostic is enabled by default.

Diagnostic text:

warning: identifier A preceded by whitespace in a literal operator declaration is deprecated

-Wdeprecated-missing-comma-variadic-parameter#

This diagnostic is enabled by default.

Diagnostic text:

warning: declaration of a variadic function without a comma before ‘…’ is deprecated

-Wdeprecated-module-dot-map#

This diagnostic is enabled by default.

Diagnostic text:

warning: ‘A’ as a module map name is deprecated, rename it to 

module.modulemap

module.private.modulemap

 in the ‘Modules’ directory of the framework

-Wdeprecated-non-prototype#

This diagnostic is enabled by default.

Diagnostic text:

warning: a function 

declaration

definition

 without a prototype is deprecated in all versions of C 

and is not supported in C23

and is treated as a zero-parameter prototype in C23, conflicting with a 

previous

subsequent

 

declaration

definition

warning: passing arguments to 

a function

B

 without a prototype is deprecated in all versions of C and is not supported in C23

-Wdeprecated-objc-isa-usage#

This diagnostic is enabled by default.

Diagnostic text:

warning: assignment to Objective-C’s isa is deprecated in favor of object_setClass()

warning: direct access to Objective-C’s isa is deprecated in favor of object_getClass()

-Wdeprecated-objc-pointer-introspection#

This diagnostic is enabled by default.

Also controls -Wdeprecated-objc-pointer-introspection-performSelector.

Diagnostic text:

warning: bitmasking for introspection of Objective-C object pointers is strongly discouraged

-Wdeprecated-objc-pointer-introspection-performSelector#

This diagnostic is enabled by default.

Diagnostic text:

warning: bitmasking for introspection of Objective-C object pointers is strongly discouraged

-Wdeprecated-octal-literals#

This diagnostic is enabled by default.

Diagnostic text:

warning: octal literals without a ‘0o’ prefix are deprecated

-Wdeprecated-ofast#

This diagnostic is enabled by default.

Diagnostic text:

warning: argument ‘-Ofast’ is deprecated; use ‘-O3’ to enable only conforming optimizations, or consult the documentation for the same behavior

warning: argument ‘-Ofast’ is deprecated; use ‘-O3 -ffast-math -fstack-arrays -fno-protect-parens’ for the same behavior, or ‘-O3 -fstack-arrays’ to enable only conforming optimizations

-Wdeprecated-pragma#

This diagnostic is enabled by default.

Diagnostic text:

warning: macro A has been marked as deprecated

: C

-Wdeprecated-redundant-constexpr-static-def#

Diagnostic text:

warning: out-of-line definition of constexpr static data member is redundant in C++17 and is deprecated

-Wdeprecated-register#

This diagnostic is enabled by default.

Diagnostic text:

warning: ‘register’ storage class specifier is deprecated and incompatible with C++17

-Wdeprecated-this-capture#

This diagnostic is enabled by default.

Diagnostic text:

warning: implicit capture of ‘this’ with a capture default of ‘=’ is deprecated

-Wdeprecated-type#

This diagnostic is enabled by default.

Diagnostic text:

warning: ‘_ExtInt’ is deprecated; use ‘_BitInt’ instead

-Wdeprecated-volatile#

This diagnostic is enabled by default.

Diagnostic text:

warning: 

decrement

increment

 of object of volatile-qualified type B is deprecated

warning: use of result of assignment to object of volatile-qualified type A is deprecated

warning: volatile-qualified parameter type A is deprecated

warning: volatile-qualified return type A is deprecated

warning: volatile qualifier in structured binding declaration is deprecated

-Wdeprecated-writable-strings#

Synonym for -Wc++11-compat-deprecated-writable-strings.

-Wdirect-ivar-access#

Diagnostic text:

warning: instance variable A is being directly accessed

-Wdisabled-macro-expansion#

Diagnostic text:

warning: disabled expansion of recursive macro

-Wdisabled-optimization#

This diagnostic flag exists for GCC compatibility, and has no effect in Clang.

-Wdiscard-qual#

This diagnostic flag exists for GCC compatibility, and has no effect in Clang.

-Wdistributed-object-modifiers#

This diagnostic is enabled by default.

Diagnostic text:

warning: conflicting distributed object modifiers on parameter type in implementation of A

warning: conflicting distributed object modifiers on return type in implementation of A

-Wdiv-by-zero#

Synonym for -Wdivision-by-zero.

-Wdivision-by-zero#

This diagnostic is enabled by default.

Diagnostic text:

warning: 

remainder

division

 by zero is undefined

-Wdll-attribute-on-redeclaration#

This diagnostic is enabled by default.

Diagnostic text:

warning: redeclaration of A should not add B attribute

-Wdllexport-explicit-instantiation#

This diagnostic is enabled by default.

Also controls -Wdllexport-explicit-instantiation-decl.

Diagnostic text:

warning: ‘dllexport’ attribute ignored on explicit instantiation definition

-Wdllexport-explicit-instantiation-decl#

This diagnostic is enabled by default.

Diagnostic text:

warning: explicit instantiation declaration should not be ‘dllexport’

-Wdllimport-static-field-def#

This diagnostic is enabled by default.

Diagnostic text:

warning: definition of dllimport static field

-Wdocumentation#

Also controls -Wdocumentation-deprecated-sync, -Wdocumentation-html.

Diagnostic text:

warning: ‘

\

@

class

interface

protocol

struct

union

‘ command should not be used in a comment attached to a non-

class

interface

protocol

struct

union

 declaration

warning: duplicated command ‘

\

@

B’

warning: empty paragraph passed to ‘

\

@

B’ command

warning: ‘

\

@

classdesign

coclass

dependency

helper

helperclass

helps

instancesize

ownership

performance

security

superclass

‘ command should not be used in a comment attached to a non-container declaration

warning: ‘

\

@

function

functiongroup

method

methodgroup

callback

‘ command should be used in a comment attached to 

a function

a function

an Objective-C method

an Objective-C method

a pointer to function

 declaration

warning: HTML start tag prematurely ended, expected attribute name or ‘>’

warning: expected quoted string after equals sign

warning: ‘

\

@

B’ command has 

no

C

 word argument

s

, expected D

warning: parameter ‘A’ is already documented

warning: unrecognized parameter passing direction, valid directions are ‘[in]’, ‘[out]’ and ‘[in,out]’

warning: ‘

\

@

param’ command used in a comment that is not attached to a function declaration

warning: parameter ‘A’ not found in the function declaration

warning: ‘

\

@

B’ command used in a comment that is attached to a 

function returning void

constructor

destructor

method returning void

warning: ‘

\

@

B’ command used in a comment that is not attached to a function or method declaration

warning: template parameter ‘A’ is already documented

warning: ‘

\

@

tparam’ command used in a comment that is not attached to a template declaration

warning: template parameter ‘A’ not found in the template declaration

warning: not a Doxygen trailing comment

warning: line splicing in Doxygen comments are not supported

warning: ‘

\

@

B’ command does not terminate a verbatim text block

-Wdocumentation-deprecated-sync#

Diagnostic text:

warning: declaration is marked with ‘

\

@

deprecated’ command but does not have a deprecation attribute

-Wdocumentation-html#

Diagnostic text:

warning: HTML end tag ‘A’ is forbidden

warning: HTML end tag does not match any start tag

warning: HTML tag ‘A’ requires an end tag

warning: HTML start tag ‘A’ closed by ‘B’

-Wdocumentation-pedantic#

Also controls -Wdocumentation-unknown-command.

Diagnostic text:

warning: whitespace is not allowed in parameter passing direction

-Wdocumentation-unknown-command#

Diagnostic text:

warning: unknown command tag name ‘A’; did you mean ‘B’?

warning: unknown command tag name

-Wdollar-in-identifier-extension#

Diagnostic text:

warning: ‘$’ in identifier

-Wdouble-promotion#

Diagnostic text:

warning: implicit conversion increases floating-point precision: A to B

-Wdtor-name#

Some of the diagnostics controlled by this flag are enabled by default.

Diagnostic text:

warning: ISO C++ considers this destructor name lookup to be ambiguous

warning: ISO C++ requires the name after ‘::~’ to be found in the same scope as the name before ‘::~’

warning: qualified destructor name only found in lexical scope; omit the qualifier to find this type name by unqualified lookup

-Wdtor-typedef#

This diagnostic is an error by default, but the flag -Wno-dtor-typedef can be used to disable the error.

Diagnostic text:

error: destructor cannot be declared using a 

typedef

type alias

 A of the class name

-Wduplicate-decl-specifier#

Some of the diagnostics controlled by this flag are enabled by default.

Diagnostic text:

warning: duplicate ‘A’ declaration specifier

warning: duplicate ‘A’ declaration specifier

warning: multiple identical address spaces specified for type

warning: duplicate ‘A’ declaration specifier

warning: duplicate interpolation modifier A

-Wduplicate-enum#

Diagnostic text:

warning: element A has been implicitly assigned B which another element has been assigned

-Wduplicate-header-ownership#

Diagnostic text:

warning: header ‘A’ is owned by multiple modules

-Wduplicate-interrupt-type#

This diagnostic is enabled by default.

Diagnostic text:

warning: RISC-V ‘interrupt’ attribute type ‘A’ specified more than once

-Wduplicate-method-arg#

Diagnostic text:

warning: redeclaration of method parameter A

-Wduplicate-method-match#

Diagnostic text:

warning: multiple declarations of method A found and ignored

-Wduplicate-protocol#

This diagnostic is enabled by default.

Diagnostic text:

warning: duplicate protocol definition of A is ignored

-Wdxil-validation#

This diagnostic is enabled by default.

Diagnostic text:

warning: dxv not found; resulting DXIL will not be validated or signed for use in release environment

-Wdynamic-class-memaccess#

This diagnostic is enabled by default.

Diagnostic text:

warning: 

destination for

source of

first operand of

second operand of

 this B call is a pointer to 

class containing a 

dynamic class D; vtable pointer will be 

overwritten

copied

moved

compared

-Wdynamic-debugging#

This diagnostic is enabled by default.

Diagnostic text:

warning: ‘-fdynamic-debugging’ ignored: requires debug info

warning: ignoring -fdynamic-debugging: unable to create target: ‘A’

-Wdynamic-exception-spec#

Some of the diagnostics controlled by this flag are enabled by default.

Also controls -Wdeprecated-dynamic-exception-spec.

Diagnostic text:

error: ISO C++17 does not allow dynamic exception specifications

-Weager-load-cxx-named-modules#

This diagnostic is enabled by default.

Diagnostic text:

warning: the form ‘-fmodule-file=<BMI-path>’ is deprecated for standard C++ named modules; consider to use ‘-fmodule-file=<module-name>=<BMI-path>’ instead

-Weffc++#

Synonym for -Wnon-virtual-dtor.

-Welaborated-enum-base#

This diagnostic is an error by default, but the flag -Wno-elaborated-enum-base can be used to disable the error.

Diagnostic text:

error: non-defining declaration of enumeration with a fixed underlying type is only permitted as a standalone declaration

; missing list of enumerators?

-Welaborated-enum-class#

This diagnostic is an error by default, but the flag -Wno-elaborated-enum-class can be used to disable the error.

Diagnostic text:

error: reference to enumeration must use ‘enum’ not ‘enum 

struct

class

‘

-Wembedded-directive#

Diagnostic text:

warning: embedding a directive within macro arguments has undefined behavior

-Wempty-body#

This diagnostic is enabled by default.

Diagnostic text:

warning: defer statement has empty body

warning: for loop has empty body

warning: if statement has empty body

warning: range-based for loop has empty body

warning: switch statement has empty body

warning: while loop has empty body

-Wempty-decomposition#

This diagnostic is enabled by default.

Diagnostic text:

warning: ISO C++17 does not allow a structured binding group to be empty

-Wempty-init-stmt#

Diagnostic text:

warning: empty initialization statement of ‘

if

switch

range-based for

‘ has no effect

-Wempty-translation-unit#

Diagnostic text:

warning: ISO C requires a translation unit to contain at least one declaration

-Wencode-type#

This diagnostic is enabled by default.

Diagnostic text:

warning: encoding of A type is incomplete because B component has unknown encoding

-Wendif-labels#

Synonym for -Wextra-tokens.

-Wenum-compare#

This diagnostic is enabled by default.

Also controls -Wdeprecated-enum-compare, -Wenum-compare-switch.

Diagnostic text:

warning: 

arithmetic between

bitwise operation between

comparison of

conditional expression between

compound assignment of

 different enumeration types

 (B and C)

-Wenum-compare-conditional#

Some of the diagnostics controlled by this flag are enabled by default.

Also controls -Wdeprecated-enum-compare-conditional.

Diagnostic text:

warning: 

arithmetic between

bitwise operation between

comparison of

conditional expression between

compound assignment of

 different enumeration types

 (B and C)

-Wenum-compare-switch#

This diagnostic is enabled by default.

Diagnostic text:

warning: comparison of different enumeration types in switch statement

 (A and B)

-Wenum-compare-typo#

This diagnostic is enabled by default.

Diagnostic text:

warning: comparison operator ‘A’ is potentially a typo for a shift operator ‘B’

-Wenum-conversion#

Some of the diagnostics controlled by this flag are enabled by default.

Controls -Wenum-compare-conditional, -Wenum-enum-conversion, -Wenum-float-conversion, -Wimplicit-enum-enum-cast.

-Wenum-enum-conversion#

Some of the diagnostics controlled by this flag are enabled by default.

Also controls -Wdeprecated-enum-enum-conversion.

Diagnostic text:

warning: 

arithmetic between

bitwise operation between

comparison of

conditional expression between

compound assignment of

 different enumeration types

 (B and C)

error: invalid 

arithmetic between

bitwise operation between

comparison of

conditional expression between

compound assignment of

 different enumeration types

 (B and C)

-Wenum-float-conversion#

Some of the diagnostics controlled by this flag are enabled by default.

Also controls -Wdeprecated-enum-float-conversion.

Diagnostic text:

warning: 

arithmetic between

bitwise operation between

comparison of

conditional expression between

compound assignment of

 

floating-point

enumeration

 type C 

with

from

and

 

enumeration

floating-point

 type D

-Wenum-too-large#

This diagnostic is enabled by default.

Diagnostic text:

warning: enumeration values exceed range of largest integer

warning: incremented enumerator value A is not representable in the largest integer type

-Wexceptions#

This diagnostic is enabled by default.

Diagnostic text:

warning: cannot refer to a non-static member from the handler of a 

constructor

destructor

 function try block

warning: exception of type A will be caught by earlier handler

warning: A has a non-throwing exception specification but can still throw

-Wexcess-initializers#

This diagnostic is enabled by default.

Diagnostic text:

warning: excess elements in 

array

vector

matrix

scalar

union

struct

 initializer

warning: excess elements in initializer for indivisible sizeless type A

warning: excess elements in char array initializer

warning: initializer-string for char array is too long

-Wexcessive-regsave#

This diagnostic is enabled by default.

Diagnostic text:

warning: 

interrupt service routine

function with attribute ‘no_caller_saved_registers’

 should only call a function with attribute ‘no_caller_saved_registers’ or be compiled with ‘-mgeneral-regs-only’

-Wexit-time-destructors#

Diagnostic text:

warning: declaration requires an exit-time destructor

-Wexpansion-stmt-missing-braces#

Diagnostic text:

warning: ISO C++ forbids attributes before the compound statement of an expansion statement

warning: ISO C++ requires the body of an expansion statement to be a compound statement

-Wexpansion-to-defined#

Some of the diagnostics controlled by this flag are enabled by default.

Diagnostic text:

warning: macro expansion producing ‘defined’ has undefined behavior

warning: macro expansion producing ‘defined’ has undefined behavior

-Wexperimental-header-units#

This diagnostic is enabled by default.

Diagnostic text:

warning: the implementation of header units is in an experimental phase

-Wexperimental-lifetime-safety-field-origin-escape#

Diagnostic text:

warning: return value depends on the object referenced by A, not on ‘*this’

Experimental. Detects member functions returning a value derived from a pointer, reference, or view field rather than from *this. May report owned pointer fields (e.g., Vector::data()), which can be silenced by marking the method [[clang::lifetimebound]].

-Wexperimental-option#

This diagnostic is enabled by default.

Diagnostic text:

warning: OpenMP support for version A in flang is still incomplete

warning: the specification for OpenMP version A is still under development; the syntax and semantics of new features may be subject to change

-Wexplicit-initialize-call#

This diagnostic is enabled by default.

Diagnostic text:

warning: explicit call to +initialize results in duplicate call to +initialize

warning: explicit call to [super initialize] should only be in implementation of +initialize

-Wexplicit-ownership-type#

Diagnostic text:

warning: method parameter of type A with no explicit ownership

-Wexplicit-specialization-storage-class#

This diagnostic is enabled by default.

Diagnostic text:

warning: explicit specialization cannot have a storage class

-Wexport-unnamed#

This diagnostic flag exists for GCC compatibility, and has no effect in Clang.

-Wext-cxx-type-aware-allocators#

This diagnostic is enabled by default.

Diagnostic text:

warning: type aware allocators are a Clang extension

-Wextern-c-compat#

This diagnostic is enabled by default.

Diagnostic text:

warning: 

empty 

struct

union

 has size 0 in C, 

size 1

non-zero size

 in C++

-Wextern-initializer#

This diagnostic is enabled by default.

Diagnostic text:

warning: ‘extern’ variable has an initializer

-Wextra#

Some of the diagnostics controlled by this flag are enabled by default.

Controls -Wcast-function-type-mismatch, -Wdeprecated-copy, -Wempty-init-stmt, -Wfuse-ld-path, -Wignored-qualifiers, -Winitializer-overrides, -Wmissing-field-initializers, -Wmissing-method-return-type, -Wnull-pointer-arithmetic, -Wnull-pointer-subtraction, -Wsemicolon-before-method-body, -Wsign-compare, -Wstring-concatenation, -Wunnecessary-virtual-specifier, -Wunterminated-string-initialization, -Wunused-but-set-parameter, -Wunused-parameter.

-Wextra-qualification#

This diagnostic is enabled by default.

Diagnostic text:

warning: extra qualification on member A

-Wextra-semi#

Also controls -Wc++11-extra-semi, -Wc++98-compat-extra-semi.

Diagnostic text:

warning: extra ‘;’ 

outside of a function

inside a B

inside instance variable list

after member function definition

warning: extra ‘;’ after member function definition

-Wextra-semi-stmt#

Also controls -Wempty-init-stmt.

Diagnostic text:

warning: empty expression statement has no effect; remove unnecessary ‘;’ to silence this warning

-Wextra-tokens#

This diagnostic is enabled by default.

Diagnostic text:

warning: extra tokens at end of #A directive

warning: extra tokens at the end of ‘#pragma omp A’ are ignored

warning: extra tokens after semicolon in ‘A’ directive

-Wextractapi-misuse#

This diagnostic is enabled by default.

Diagnostic text:

warning: missing symbol graph output directory, defaulting to working directory

-Wextraneous-template-head#

This diagnostic is an error by default, but the flag -Wno-extraneous-template-head can be used to disable the error.

Diagnostic text:

error: extraneous template parameter list in template specialization

-Wfinal-dtor-non-final-class#

This diagnostic is enabled by default.

Diagnostic text:

warning: class with destructor marked ‘

final

sealed

‘ cannot be inherited from

-Wfinal-macro#

This diagnostic is enabled by default.

Diagnostic text:

warning: macro A has been marked as final and should not be 

undefined

redefined

-Wfixed-point-overflow#

This diagnostic is enabled by default.

Diagnostic text:

warning: overflow in expression; result is A with type B

-Wflag-enum#

This diagnostic is enabled by default.

Diagnostic text:

warning: enumeration value A is out of range of flags in enumeration type B

-Wflexible-array-extensions#

Diagnostic text:

warning: A may not be used as an array element due to flexible array member

warning: A may not be nested in a struct due to flexible array member

-Wfloat-conversion#

Also controls -Wfloat-overflow-conversion, -Wfloat-zero-conversion.

Diagnostic text:

warning: implicit conversion turns floating-point number into integer: A to B

-Wfloat-equal#

Diagnostic text:

warning: comparing floating point with == or != is unsafe

-Wfloat-overflow-conversion#

Diagnostic text:

warning: implicit conversion from A to B changes value from C to D

warning: implicit conversion of out of range value from A to B is undefined

-Wfloat-zero-conversion#

Diagnostic text:

warning: implicit conversion from A to B changes non-zero value from C to D

-Wfor-loop-analysis#

Diagnostic text:

warning: variable A is 

decremented

incremented

 both in the loop header and in the loop body

warning: variable

s

 B

s B and C

s B, C, and D

s B, C, D, and E

 used in loop condition not modified in loop body

-Wformat#

This diagnostic is enabled by default.

Also controls -Wformat-extra-args, -Wformat-insufficient-args, -Wformat-invalid-specifier, -Wformat-overflow, -Wformat-security, -Wformat-truncation, -Wformat-y2k, -Wformat-zero-length, -Wnonnull.

Diagnostic text:

warning: using ‘%%P’ format specifier without precision

warning: using ‘%%P’ format specifier with an Objective-C pointer results in dumping runtime object structure, not object value

warning: 

values of type

enum values with underlying type

 ‘A’ should not be used as format arguments; add an explicit cast to B instead

warning: using ‘A’ format specifier, but argument has boolean value

warning: format argument modifies specifier at position A, but it should modify specifier at position B

warning: format argument is 

a value

an indirect field width

an indirect precision

an auxiliary value

, but it should be 

a value

an indirect field width

an indirect precision

an auxiliary value

warning: argument sensitivity is 

unspecified

private

public

sensitive

, but it should be 

unspecified

private

public

sensitive

warning: format specifier ‘A’ is incompatible with ‘B’

warning: format specifies type A but the argument has 

type

underlying type

 B

warning: using ‘A’ format specifier annotation outside of os_log()/os_trace()

warning: invalid position specified for 

field width

field precision

warning: cannot mix positional and non-positional arguments in format string

warning: length modifier ‘A’ results in undefined behavior or no effect with ‘B’ conversion specifier

warning: format string should not be a wide string

warning: passing ‘A’ format string where ‘B’ format string is expected

warning: format specifies type A which is not supported yet

warning: position arguments in format strings start counting at 1 (not 0)

warning: format string missing

warning: object format flags cannot be used with ‘A’ conversion specifier

warning: ‘

*

.*

‘ specified field 

width

precision

 is missing a matching ‘int’ argument

warning: field 

width

precision

 should have type B, but argument has type C

warning: missing object format flag

warning: format string contains ‘\0’ within the string body

warning: format string is not null-terminated

warning: flag ‘A’ is ignored when flag ‘B’ is present

warning: incomplete format specifier

warning: ‘A’ is not a valid object format flag

warning: ‘%%n’ specifier not supported on this platform

warning: flag ‘A’ results in undefined behavior with ‘B’ conversion specifier

warning: 

field width

precision

 used with ‘B’ conversion specifier, resulting in undefined behavior

warning: data argument position ‘A’ exceeds the number of data arguments (B)

warning: zero field width in scanf format string is unused

warning: no closing ‘]’ for ‘%%[’ in scanf format string

-Wformat-extra-args#

This diagnostic is enabled by default.

Diagnostic text:

warning: data argument not used by format string

-Wformat-insufficient-args#

This diagnostic is enabled by default.

Diagnostic text:

warning: 

fewer

more

 specifiers in format string than expected

warning: more ‘%%’ conversions than data arguments

-Wformat-invalid-specifier#

This diagnostic is enabled by default.

Diagnostic text:

warning: invalid conversion specifier ‘A’

-Wformat-non-iso#

Diagnostic text:

warning: ‘A’ 

length modifier

conversion specifier

 is not supported by ISO C

warning: using length modifier ‘A’ with conversion specifier ‘B’ is not supported by ISO C

warning: positional arguments are not supported by ISO C

-Wformat-nonliteral#

Also controls -Wmissing-format-attribute.

Diagnostic text:

warning: format string is not a string literal

-Wformat-overflow#

This diagnostic is enabled by default.

Also controls -Wformat-overflow-non-kprintf.

Diagnostic text:

warning: ‘A’ will always overflow; destination buffer has size B, but format string expands to at least C

-Wformat-overflow-non-kprintf#

This diagnostic is enabled by default.

Diagnostic text:

warning: ‘A’ will always overflow; destination buffer has size B, but format string expands to at least C

-Wformat-pedantic#

Diagnostic text:

warning: 

values of type

enum values with underlying type

 ‘A’ should not be used as format arguments; add an explicit cast to B instead

warning: signedness of format specifier ‘A’ is incompatible with ‘B’

warning: format specifies type A but the argument has 

type

underlying type

 B

-Wformat-security#

This diagnostic is enabled by default.

Diagnostic text:

warning: format string is not a string literal (potentially insecure)

-Wformat-signedness#

Diagnostic text:

warning: signedness of format specifier ‘A’ is incompatible with ‘B’

warning: format specifies type A but the argument has 

type

underlying type

 B, which differs in signedness

-Wformat-truncation#

This diagnostic is enabled by default.

Also controls -Wformat-truncation-non-kprintf.

Diagnostic text:

warning: ‘A’ will always be truncated; specified size is B, but format string expands to at least C

-Wformat-truncation-non-kprintf#

This diagnostic is enabled by default.

Diagnostic text:

warning: ‘A’ will always be truncated; specified size is B, but format string expands to at least C

-Wformat-type-confusion#

Diagnostic text:

warning: format specifies type A but the argument has 

type

underlying type

 B

-Wformat-y2k#

This diagnostic flag exists for GCC compatibility, and has no effect in Clang.

-Wformat-zero-length#

This diagnostic is enabled by default.

Diagnostic text:

warning: format string is empty

-Wformat=2#

Some of the diagnostics controlled by this flag are enabled by default.

Controls -Wformat-nonliteral, -Wformat-security, -Wformat-y2k.

-Wfortify-source#

This diagnostic is enabled by default.

Also controls -Wformat-overflow, -Wformat-truncation.

Diagnostic text:

warning: ‘A’ may overflow; destination buffer in argument B has size C, but the corresponding specifier may require size D

warning: ‘A’ size argument is negative

warning: ‘A’ will always overflow; destination buffer has size B, but size argument is C

warning: ‘A’ will always read past the end of the source buffer; source buffer has size B, but the size is C

warning: ‘A’ size argument is too large; destination buffer has size B, but size argument is C

warning: ‘A’ will always overflow; destination buffer has size B, but the source string has length C (including NUL byte)

warning: ‘umask’ argument sets non-file-permission bits (0A); those bits are ignored

-Wfour-char-constants#

Diagnostic text:

warning: multi-character character constant

-Wframe-address#

Diagnostic text:

warning: calling ‘A’ with a nonzero argument is unsafe

-Wframe-larger-than#

This diagnostic is enabled by default.

Diagnostic text:

The text of this diagnostic is not controlled by Clang.

warning: stack frame size (A) exceeds limit (B) in ‘C’

More fine grained information about the stack layout is available by adding the -Rpass-analysis=stack-frame-layout command-line flag to the compiler invocation.

The diagnostic information can be saved to a file in a machine readable format, like YAML by adding the -foptimization-record-file=<file> command-line flag.

Results can be filtered by function name by passing -mllvm -filter-print-funcs=foo, where foo is the target function’s name.

clang -c a.cpp -Rpass-analysis=stack-frame-layout -mllvm -filter-print-funcs=foo
clang -c a.cpp -Rpass-analysis=stack-frame-layout -foptimization-record-file=<file>

-Wframe-larger-than=#

Synonym for -Wframe-larger-than.

-Wframework-include-private-from-public#

This diagnostic is enabled by default.

Diagnostic text:

warning: public framework header includes private framework header ‘A’

-Wfree-nonheap-object#

This diagnostic is enabled by default.

Diagnostic text:

warning: attempt to call A on non-heap 

object C

object: block expression

object: lambda-to-function-pointer conversion

-Wfriend-enum#

This diagnostic is enabled by default.

Diagnostic text:

warning: elaborated enum specifier cannot be declared as a friend

-Wfunction-def-in-objc-container#

This diagnostic is enabled by default.

Diagnostic text:

warning: function definition inside an Objective-C container is deprecated

-Wfunction-effect-redeclarations#

Diagnostic text:

warning: overriding function is missing ‘A’ attribute from base declaration

warning: redeclaration is missing ‘A’ attribute from previous declaration

-Wfunction-effects#

Diagnostic text:

warning: attribute ‘A’ on overriding function conflicts with base declaration

warning: effects conflict when merging declarations; kept ‘A’, discarded ‘B’

warning: 

function

constructor

destructor

lambda

block

member initializer of constructor

 with ‘B’ attribute must not call non-’B’ expression

warning: 

function

constructor

destructor

lambda

block

member initializer of constructor

 with ‘B’ attribute must not call non-’B’ 

function

constructor

destructor

lambda

block

 ‘D’

warning: 

function

constructor

destructor

lambda

block

member initializer of constructor

 with ‘B’ attribute must not 

allocate or deallocate memory

throw or catch exceptions

have static local variables

use thread-local variables

access ObjC methods or properties

warning: attribute ‘A’ should not be added via type conversion

-Wfunction-multiversion#

This diagnostic is enabled by default.

Also controls -Wtarget-clones-mixed-specifiers.

Diagnostic text:

warning: body of cpu_dispatch function will be ignored

warning: priority of default version cannot be overridden; ignoring priority

warning: CPU list contains duplicate entries; attribute ignored

warning: version list contains duplicate entries

warning: version list contains entries that don’t impact code generation

warning: function version ‘A’ is unreachable; ignoring version

warning: version priority ‘A’ is outside the allowed range [1-255]; ignoring priority

-Wfuse-ld-path#

Diagnostic text:

warning: ‘-fuse-ld=’ taking a path is deprecated; use ‘–ld-path=’ instead

-Wfuture-attribute-extensions#

Controls -Wc++14-attribute-extensions, -Wc++17-attribute-extensions, -Wc++20-attribute-extensions, -Wc++23-attribute-extensions.

-Wfuture-compat#

This diagnostic flag exists for GCC compatibility, and has no effect in Clang.

-Wgcc-compat#

Some of the diagnostics controlled by this flag are enabled by default.

Diagnostic text:

warning: ‘diagnose_if’ is a clang extension

warning: ‘enable_if’ is a clang extension

warning: __final is a GNU extension, consider using C++11 final

warning: GCC does not allow A attribute in this position on a function definition

warning: GCC does not allow the ‘cleanup’ attribute argument to be anything other than a simple identifier

warning: GCC does not allow an attribute in this position on a function declaration

warning: GCC does not allow the A attribute to be written on a type

warning: GCC requires a function with the A attribute to be variadic

warning: GCC does not allow variable declarations in for loop initializers before C99

-Wgcc-install-dir-libstdcxx#

This diagnostic is enabled by default.

Diagnostic text:

warning: future releases of the clang compiler will prefer GCC installations containing libstdc++ include directories; ‘A’ would be chosen over ‘B’

-Wglobal-constructors#

Diagnostic text:

warning: declaration requires a global constructor

warning: declaration requires a global destructor

Emit a warning for each variable declaration that generates code run at startup.

-Wglobal-isel#

This diagnostic is enabled by default.

Diagnostic text:

warning: -fglobal-isel support for the ‘A’ architecture is incomplete

warning: -fglobal-isel support is incomplete for this architecture at the current optimization level

-Wgnu#

Some of the diagnostics controlled by this flag are enabled by default.

Controls -Wgnu-alignof-expression, -Wgnu-anonymous-struct, -Wgnu-auto-type, -Wgnu-binary-literal, -Wgnu-case-range, -Wgnu-complex-integer, -Wgnu-compound-literal-initializer, -Wgnu-conditional-omitted-operand, -Wgnu-designator, -Wgnu-empty-struct, -Wgnu-flexible-array-initializer, -Wgnu-flexible-array-union-member, -Wgnu-folding-constant, -Wgnu-imaginary-constant, -Wgnu-include-next, -Wgnu-label-as-value, -Wgnu-line-marker, -Wgnu-null-pointer-arithmetic, -Wgnu-offsetof-extensions, -Wgnu-pointer-arith, -Wgnu-redeclared-enum, -Wgnu-statement-expression, -Wgnu-static-float-init, -Wgnu-string-literal-operator-template, -Wgnu-union-cast, -Wgnu-variable-sized-type-not-at-end, -Wgnu-zero-line-directive, -Wgnu-zero-variadic-macro-arguments, -Wredeclared-class-member, -Wvla-extension, -Wzero-length-array.

-Wgnu-alignof-expression#

This diagnostic is enabled by default.

Diagnostic text:

warning: A applied to an expression is a GNU extension

-Wgnu-anonymous-struct#

Diagnostic text:

warning: anonymous structs are a GNU extension

-Wgnu-array-member-paren-init#

This diagnostic is an error by default, but the flag -Wno-gnu-array-member-paren-init can be used to disable the error.

Diagnostic text:

error: parenthesized initialization of a member array is a GNU extension

-Wgnu-auto-type#

Diagnostic text:

warning: ‘__auto_type’ is a GNU extension

-Wgnu-binary-literal#

This diagnostic flag exists for GCC compatibility, and has no effect in Clang.

-Wgnu-case-range#

Diagnostic text:

warning: case ranges are a GNU extension

-Wgnu-complex-integer#

Diagnostic text:

warning: complex integer types are a GNU extension

-Wgnu-compound-literal-initializer#

Diagnostic text:

warning: initialization of an array 

of type A from a compound literal of type B

from a compound literal

 is a GNU extension

-Wgnu-conditional-omitted-operand#

Diagnostic text:

warning: use of GNU ?: conditional expression extension, omitting middle operand

-Wgnu-designator#

Some of the diagnostics controlled by this flag are enabled by default.

Diagnostic text:

warning: use of GNU array range extension

warning: use of GNU ‘missing =’ extension in designator

warning: use of GNU old-style field designator extension

-Wgnu-empty-initializer#

This diagnostic flag exists for GCC compatibility, and has no effect in Clang.

-Wgnu-empty-struct#

Diagnostic text:

warning: empty 

struct

union

 is a GNU extension

warning: flexible array member A in otherwise empty 

struct

interface

union

class

enum

 is a GNU extension

warning: 

struct

union

 without named members is a GNU extension

-Wgnu-flexible-array-initializer#

Diagnostic text:

warning: flexible array initialization is a GNU extension

-Wgnu-flexible-array-union-member#

Diagnostic text:

warning: flexible array member A in a union is a GNU extension

-Wgnu-folding-constant#

Some of the diagnostics controlled by this flag are enabled by default.

Diagnostic text:

warning: expression is not an 

integer

integral

 constant expression; folding it to a constant is a GNU extension

warning: in-class initializer for static data member is not a constant expression; folding it to a constant is a GNU extension

warning: variable length array folded to constant array as an extension

-Wgnu-imaginary-constant#

Diagnostic text:

warning: imaginary constants are a GNU extension

-Wgnu-include-next#

Diagnostic text:

warning: #include_next is a language extension

-Wgnu-inline-cpp-without-extern#

This diagnostic is enabled by default.

Diagnostic text:

warning: ‘gnu_inline’ attribute without ‘extern’ in C++ treated as externally available, this changed in Clang 10

-Wgnu-label-as-value#

Diagnostic text:

warning: use of GNU address-of-label extension

warning: use of GNU indirect-goto extension

-Wgnu-line-marker#

Diagnostic text:

warning: this style of line directive is a GNU extension

-Wgnu-null-pointer-arithmetic#

Diagnostic text:

warning: arithmetic on a null pointer treated as a cast from integer to pointer is a GNU extension

-Wgnu-offsetof-extensions#

This diagnostic flag exists for GCC compatibility, and has no effect in Clang.

-Wgnu-pointer-arith#

Diagnostic text:

warning: ‘

counted_by

sized_by

counted_by_or_null

sized_by_or_null

‘ on a pointer to void is a GNU extension, treated as ‘

sized_by

sized_by

sized_by_or_null

sized_by_or_null

‘

warning: arithmetic on

 a

 pointer

s

 to

 the

 function type

s

 B

 and D

 is a GNU extension

warning: subscript of a pointer to void is a GNU extension

warning: arithmetic on

 a

 pointer

s

 to void is a GNU extension

-Wgnu-redeclared-enum#

Diagnostic text:

warning: redeclaration of already-defined enum A is a GNU extension

-Wgnu-statement-expression#

Also controls -Wgnu-statement-expression-from-macro-expansion.

Diagnostic text:

warning: use of GNU statement expression extension

-Wgnu-statement-expression-from-macro-expansion#

Diagnostic text:

warning: use of GNU statement expression extension from macro expansion

-Wgnu-static-float-init#

This diagnostic is enabled by default.

Diagnostic text:

warning: in-class initializer for static data member of type A is a GNU extension

-Wgnu-string-literal-operator-template#

This diagnostic is enabled by default.

Diagnostic text:

warning: string literal operator templates are a GNU extension

-Wgnu-union-cast#

Diagnostic text:

warning: cast to union type is a GNU extension

-Wgnu-variable-sized-type-not-at-end#

This diagnostic is enabled by default.

Diagnostic text:

warning: field A with variable sized type B not at the end of a struct or class is a GNU extension

-Wgnu-zero-line-directive#

Diagnostic text:

warning: #line directive with zero argument is a GNU extension

-Wgnu-zero-variadic-macro-arguments#

Also controls -Wvariadic-macro-arguments-omitted.

Diagnostic text:

warning: token pasting of ‘,’ and ‘__VA_ARGS__’ is a GNU extension

; consider using ‘__VA_OPT__(,)’ instead

-Wgpu-maybe-wrong-side#

This diagnostic is enabled by default.

Diagnostic text:

warning: capture host side class data member by this pointer in device or host device lambda function may result in invalid memory access if this pointer is not accessible on device side

-Wgroupshared-initializer#

This diagnostic is an error by default, but the flag -Wno-groupshared-initializer can be used to disable the error.

Diagnostic text:

error: initializer of groupshared variable will be ignored

-Wheader-guard#

This diagnostic is enabled by default.

Diagnostic text:

warning: A is used as a header guard here, followed by #define of a different macro

-Wheader-hygiene#

Diagnostic text:

warning: using namespace directive in global context in header

-Whexagon-reserved-caller-saved#

This diagnostic is enabled by default.

Diagnostic text:

warning: reserving the caller-saved register ‘A’ may lead to incorrect code if it is not also reserved in all other translation units and libraries; you are responsible for ensuring the register is managed consistently

-Whigher-precision-for-complex-division#

This diagnostic is enabled by default.

Diagnostic text:

warning: excess precision is requested but the target does not support excess precision which may result in observable differences in complex division behavior

, additional uses where the requested higher precision cannot be honored were found but not diagnosed

-Whip-deprecated-builtins#

Diagnostic text:

warning: builtin A is deprecated; use B instead

-Whip-omp-target-directives#

This diagnostic is an error by default, but the flag -Wno-hip-omp-target-directives can be used to disable the error.

Diagnostic text:

error: HIP does not support OpenMP target directives; directive has been ignored

-Whip-only#

This diagnostic is enabled by default.

Diagnostic text:

warning: ‘A’ is ignored since it is only supported for HIP

-Whlsl-202y-extensions#

This diagnostic is enabled by default.

Diagnostic text:

warning: ‘auto’ type specifier is a 

C++11

HLSL 202y

 extension

-Whlsl-availability#

This diagnostic is enabled by default.

Diagnostic text:

error: A is only available 

in E environment 

on B C or newer

error: A is unavailable

warning: support for groupshared parameter annotation not added until HLSL 202x

warning: passing groupshared variable to a parameter annotated with inout. See ‘groupshared’ parameter annotation added in 202x

-Whlsl-dxc-compatability#

This diagnostic is enabled by default.

Diagnostic text:

warning: failed to embed source for ‘A’ into dx.source.contents

warning: support for HLSL language version A is incomplete, recommend using B instead

-Whlsl-explicit-binding#

This diagnostic is enabled by default.

Diagnostic text:

warning: assignment of A to local resource B is not to the same unique global resource

-Whlsl-extensions#

This diagnostic is enabled by default.

Also controls -Whlsl-202y-extensions.

Diagnostic text:

warning: access specifiers are a clang HLSL extension

warning: lambdas are a 

C++11

clang HLSL

 extension

-Whlsl-implicit-binding#

Diagnostic text:

warning: resource has implicit register binding

-Whlsl-semantic-signatures#

This diagnostic is enabled by default.

Diagnostic text:

warning: semantic signature packing mode ‘A’ is ignored as 

vertex shader inputs

pixel shader outputs

 always use 

stacked

indexed

 packing

-Widiomatic-parentheses#

Diagnostic text:

warning: using the result of an assignment as a condition without parentheses

-Wignored-attributes#

This diagnostic is enabled by default.

Also controls -Wdllexport-explicit-instantiation.

Diagnostic text:

warning: ‘trivial_abi’ cannot be applied to A

warning: 

alias

ifunc

 will always resolve to A even if weak definition of B is overridden

warning: 

alias

ifunc

 will not be in section ‘A’ but in the same section as the 

aliasee

resolver

warning: requested alignment is less than minimum alignment of B for type A

warning: ‘abi_tag’ attribute on 

non-inline

anonymous

 namespace ignored

warning: ‘dllexport’ attribute ignored on explicit instantiation definition

warning: attribute A after definition is ignored

warning: ‘cmse_nonsecure_entry’ cannot be applied to functions with internal linkage

warning: A attribute ignored on local class

 member

warning: A attribute ignored because Clang does not yet support this attribute signature

warning: ‘harden-pac-ret’ attribute requires ‘branch-protection=pac-ret’; ‘target’ attribute ignored

warning: attribute A has no effect when annotating an ‘if 

constexpr

consteval

‘ statement

warning: attribute A has no effect when annotating an infinite loop

warning: ‘hybrid_patchable’ is ignored on functions without external linkage

warning: A attribute can only be applied to instance variables or properties

warning: A attribute ignored

warning: A attribute ignored for field of type B

warning: A attribute is ignored because there exists no call expression inside the statement

warning: A attribute is ignored because B is not a function pointer

warning: A attribute ignored on inline function

warning: A attribute ignored on a non-definition declaration

warning: ‘A’ attribute cannot be specified on a definition

warning: A attribute is ignored in non-aggregate type B

warning: attribute A ignored, because it is not attached to a declaration

warning: A

 attribute

 only applies to fields or variables of character array type; type is C

warning: ‘nonnull’ attribute applied to function with no pointer arguments

warning: ‘nonnull’ attribute when used on parameters takes no arguments

warning: A attribute ignored when parsing type

warning: attribute A cannot be applied to a ‘void’ parameter

warning: A attribute only applies to a pointer or reference (B is invalid)

warning: A attribute only applies to

 constant

 pointer arguments

warning: attribute declaration must precede definition

warning: A attribute only applies to return values that are pointers

warning: A attribute only applies to return values that are pointers or references

warning: A attribute only applies to functions that return span-like structures

warning: ‘sentinel’ attribute requires named arguments

warning: ‘sentinel’ attribute only supported for variadic 

functions

blocks

warning: A attribute argument not supported: B

warning: A attribute argument ‘B’ not supported on a global variable

warning: unknown visibility A

warning: attribute A cannot be applied to 

functions

Objective-C method

 without return value

warning: __weak attribute cannot be specified on a field declaration

warning: __weak attribute cannot be specified on an automatic variable when ARC is not enabled

warning: A

 attribute

 only applies to 

functions

unions

variables and functions

functions and methods

functions, methods and blocks

functions, methods, and parameters

variables

variables and fields

variables, data members and tag types

types and namespaces

variables, functions and classes

kernel functions

non-K&R-style functions

for loop statements

virtual functions

parameters and implicit object parameters

non-member functions

functions, classes, or enumerations

classes

typedefs

warning: A

 attribute

 only applies to C

warning: conflicting attributes A are ignored

warning: attribute A ignored, because it cannot be applied to omitted return type

warning: A calling convention is not supported 

for this target

on variadic function

on constructor/destructor

on builtin function

warning: ‘const’ attribute imposes more restrictions; ‘pure’ attribute ignored

warning: maxclusterrank requires sm_90 or higher, CUDA arch provided: A, ignoring B attribute

warning: attribute A ignored, because it cannot be applied to a type

warning: ignoring __declspec(allocator) because the function return type A is not a pointer or reference type

warning: attribute A is ignored, place it after “

class

struct

interface

union

enum

enum class

enum struct

“ to apply attribute to type declaration

warning: ‘deprecated’ attribute on anonymous namespace ignored

warning: A currently has no effect on a using declaration

warning: A attribute ignored; B takes precedence

warning: exporting inherited constructor is not yet supported; ‘dllexport’ ignored on inherited constructor with 

variadic arguments

callee-cleanup parameters

warning: explicit instantiation definition is not exported without ‘dllexport’

warning: A redeclared inline; B attribute ignored

warning: attribute A is already applied with different arguments

warning: attribute A is already applied

warning: declaration has multiple ‘cleanup’ attributes; all but the last one will be ignored

warning: attribute is ignored on this statement as it only applies to functions; use ‘A’ on statements

warning: statement attribute A has higher precedence than function attribute ‘

always_inline

flatten

noinline

‘

warning: Objective-C GC does not allow weak variables on the stack

warning: ‘gnu_inline’ attribute requires function to be marked ‘inline’, attribute ignored

warning: interpolation modifier ‘

centroid

sample

‘ overrides ‘

center

centroid

‘

warning: inheritance model ignored on 

primary template

partial specialization

warning: ‘objc_externally_retained’ can only be applied to local variables 

of retainable type

with strong ownership

warning: import 

module

name

 cannot be applied to a 

function

variable

 with a definition

warning: ‘internal_linkage’ attribute on a non-static local variable is ignored

warning: 

MIPS

MSP430

RISC-V

AVR

 ‘

interrupt

signal

‘ attribute only applies to functions that have 

no parameters

a ‘void’ return type

warning: qualifiers after comma in declarator list are ignored

warning: ‘mig_server_routine’ attribute only applies to routines that return a kern_return_t

warning: 

import module

import name

export name

 (B) does not match the 

import module

import name

export name

 (C) of the previous declaration

warning: unknown attribute ‘A’

warning: ‘nocf_check’ attribute ignored; use -fcf-protection to enable the attribute

warning: ‘noderef’ can only be used on an array or pointer type

warning: ‘nothrow’ attribute conflicts with exception specification; attribute ignored

warning: A attribute only applies to 

Objective-C object

pointer

pointer-to-CF-pointer

pointer/reference-to-OSObject-pointer

 parameters

warning: A attribute only applies to 

functions

methods

properties

 that return 

an Objective-C object

a pointer

a non-retainable pointer

warning: A attribute isn’t implemented by this Objective-C runtime

warning: direct attribute on property A ignored (not implemented by this Objective-C runtime)

warning: A attribute is deprecated and ignored in B

warning: ‘

pure

const

‘ attribute on function returning ‘void’; attribute ignored

warning: ‘require_constant_initialization’ attribute added after initialization of variable

warning: repeated RISC-V ‘interrupt’ attribute

warning: ‘stack_protector_ignore’ attribute ignored due to ‘-fstack-protector-all’ option

warning: attribute is ignored on this function as it only applies to statements; use ‘A’ for functions

warning: template parameter of a function template with the ‘sycl_kernel’ attribute cannot be a non-type template parameter

warning: function template with ‘sycl_kernel’ attribute must have a single parameter

warning: ‘sycl_kernel’ attribute only applies to a function template with at least two template parameters

warning: function template with ‘sycl_kernel’ attribute must have a ‘void’ return type

warning: 

alignment

size

 of field B (C bits) does not match the 

alignment

size

 of the first field in transparent union; transparent_union attribute ignored

warning: first field of a transparent union cannot have 

floating point

vector

 type B; transparent_union attribute ignored

warning: transparent_union attribute can only be applied to a union definition; attribute ignored

warning: transparent union definition must contain at least one field; transparent_union attribute ignored

warning: ‘A’ only applies to 

function

pointer

Objective-C object or block pointer

 types; type here is C

warning: __declspec attribute A is not supported

warning: 

unsupported

duplicate

unknown

 CPU

 tune CPU

 ‘C’ in the ‘

target

target_clones

target_version

‘ attribute string; ‘

target

target_clones

target_version

‘ attribute ignored

warning: ‘[[

nodiscard

gnu::warn_unused_result

]]’ attribute ignored when applied to a typedef; consider using ‘__attribute__((warn_unused_result))’ or ‘[[clang::warn_unused_result]]’ instead

warning: ‘__clang__’ is a predefined macro name, not an attribute scope specifier; did you mean ‘_Clang’ instead?

-Wignored-availability-without-sdk-settings#

This diagnostic is enabled by default.

Diagnostic text:

warning: A availability is ignored without a valid ‘SDKSettings.json’ in the SDK

-Wignored-base-class-qualifiers#

Some of the diagnostics controlled by this flag are enabled by default.

Also controls -Wignored-qualifiers.

Diagnostic text:

warning: ‘A’ qualifier

s

 on base class type C 

has

have

 no effect

-Wignored-gch#

This diagnostic is enabled by default.

Diagnostic text:

warning: precompiled header directory ‘A’ was ignored because it contains no clang PCH files

warning: precompiled header ‘A’ was ignored because it is not a clang PCH file

-Wignored-optimization-argument#

This diagnostic is enabled by default.

Diagnostic text:

warning: optimization flag ‘A’ is not supported for target ‘B’

warning: optimization flag ‘A’ is not supported

-Wignored-pragma-intrinsic#

This diagnostic is enabled by default.

Diagnostic text:

warning: A is not a recognized builtin

; consider including <intrin.h> to access non-builtin intrinsics

-Wignored-pragma-optimize#

This diagnostic flag exists for GCC compatibility, and has no effect in Clang.

-Wignored-pragmas#

This diagnostic is enabled by default.

Also controls -Wignored-pragma-intrinsic, -Wignored-pragma-optimize.

Diagnostic text:

warning: expected string 

literal 

in ‘clause A’ - ignoring

warning: failed to resolve ‘#pragma A’ to a declaration

warning: ‘#pragma 

push_macro

pop_macro

‘ expected a non-empty string

warning: expected ‘=’ following ‘#pragma 

align

options align

‘ - ignored

warning: invalid alignment option in ‘#pragma 

align

options align

‘ - ignored

warning: ‘#pragma comment A’ ignored

warning: ‘#pragma comment A’ ignored: it can be specified only once per translation unit

warning: 

value

type

-dependent expression passed as an argument to debug command

warning: missing argument to debug command ‘A’

warning: missing debug command

warning: unable to find module ‘A’

warning: unexpected argument to debug command

warning: unexpected debug command ‘A’

warning: unknown module ‘A’

warning: expected action or ‘)’ in ‘#pragma A’ - ignored

warning: missing ‘:’ after A - ignoring

warning: missing ‘:’ or ‘)’ after A - ignoring

warning: expected ‘,’ in ‘#pragma A’

warning: expected identifier in ‘#pragma A’ - ignored

warning: expected ‘compiler’, ‘lib’, ‘user’, or a string literal for the section name in ‘#pragma A’ - ignored

warning: expected integer between A and B inclusive in ‘#pragma C’ - ignored

warning: missing ‘(’ after ‘#pragma A’ - ignoring

warning: expected non-wide string literal in ‘#pragma A’

warning: expected 

‘enable’, ‘disable’, ‘begin’ or ‘end’

‘disable’

 - ignoring

warning: expected ‘)’ or ‘,’ in ‘#pragma A’

warning: missing ‘)’ after ‘#pragma A’ - ignoring

warning: expected a stack label or a string literal for the section name in ‘#pragma A’ - ignored

warning: expected a string literal for the section name in ‘#pragma A’ - ignored

warning: expected push, pop or a string literal for the section name in ‘#pragma A’ - ignored

warning: expected string literal in ‘#pragma A’ - ignoring

warning: extra tokens at end of ‘#pragma A’ - ignored

warning: incorrect use of #pragma clang force_cuda_host_device begin|end

warning: ‘#pragma A’ is not supported on this target - ignored

warning: ‘#pragma init_seg’ is only supported when targeting a Microsoft environment

warning: unknown action for ‘#pragma A’ - ignored

warning: unexpected argument ‘A’ to ‘#pragma B’

; expected D

warning: unknown action ‘B’ for ‘#pragma A’ - ignored

warning: missing argument to ‘#pragma A’

; expected C

warning: incorrect use of ‘#pragma fenv_access (on|off)’ - ignored

warning: incorrect use of ‘#pragma ms_struct on|off’ - ignored

warning: #pragma A is applicable to symbols with external linkage only; not applied to B

warning: #pragma A can only applied before a symbol is defined

warning: #pragma options align=reset failed: A

warning: expected ‘align’ following ‘#pragma options’ - ignored

warning: expected #pragma pack parameter to be ‘1’, ‘2’, ‘4’, ‘8’, or ‘16’

warning: expected integer or identifier in ‘#pragma pack’ - ignored

warning: #pragma A(pop, …) failed: B

warning: pragma pop_macro could not pop ‘A’, no matching push_macro

warning: OpenCL extension A unknown or does not require pragma - ignoring

warning: known but unsupported action ‘B’ for ‘#pragma A’ - ignored

warning: unsupported OpenCL extension A - ignoring

warning: expected ‘#pragma unused’ argument to be a variable name

warning: only variables can be arguments to ‘#pragma unused’

warning: undeclared variable A used as an argument for ‘#pragma unused’

warning: invalid or unsupported rounding mode in ‘#pragma STDC FENV_ROUND’ - ignored

-Wignored-qualifiers#

Some of the diagnostics controlled by this flag are enabled by default.

Also controls -Wignored-reference-qualifiers.

Diagnostic text:

warning: ‘A’ qualifier on function type B has no effect and is a Clang extension

warning: ARC 

unused

__unsafe_unretained

__strong

__weak

__autoreleasing

 lifetime qualifier on return type is ignored

warning: ‘A’ qualifier on omitted return type B has no effect

warning: ‘A’ type qualifier

s

 on return type 

has

have

 no effect

warning: ‘A’ qualifier on function type B has no effect

-Wignored-reference-qualifiers#

This diagnostic is enabled by default.

Diagnostic text:

warning: ‘A’ qualifier on reference type B has no effect

-Wimplicit#

Some of the diagnostics controlled by this flag are enabled by default.

Controls -Wimplicit-function-declaration, -Wimplicit-int.

-Wimplicit-atomic-properties#

Diagnostic text:

warning: property is assumed atomic when auto-synthesizing the property

warning: property is assumed atomic by default

-Wimplicit-const-int-float-conversion#

This diagnostic is enabled by default.

Diagnostic text:

warning: implicit conversion from C to D changes value from A to B

-Wimplicit-conversion-floating-point-to-bool#

This diagnostic is enabled by default.

Diagnostic text:

warning: implicit conversion turns floating-point number into bool: A to B

-Wimplicit-enum-enum-cast#

This diagnostic is enabled by default.

Diagnostic text:

warning: implicit conversion from enumeration type A to different enumeration type B

-Wimplicit-exception-spec-mismatch#

This diagnostic is enabled by default.

Diagnostic text:

warning: function previously declared with an 

explicit

implicit

 exception specification redeclared with an 

implicit

explicit

 exception specification

-Wimplicit-fallthrough#

Also controls -Wimplicit-fallthrough-per-function.

Diagnostic text:

warning: unannotated fall-through between switch labels

-Wimplicit-fallthrough-per-function#

Diagnostic text:

warning: unannotated fall-through between switch labels in partly-annotated function

-Wimplicit-fixed-point-conversion#

This diagnostic is enabled by default.

Diagnostic text:

warning: implicit conversion from A cannot fit within the range of values for B

-Wimplicit-float-conversion#

Some of the diagnostics controlled by this flag are enabled by default.

Also controls -Wimplicit-int-float-conversion, -Wobjc-signed-char-bool-implicit-float-conversion.

Diagnostic text:

warning: implicit conversion loses floating-point precision: A to B

warning: implicit conversion when assigning computation result loses floating-point precision: A to B

-Wimplicit-function-declaration#

Some of the diagnostics controlled by this flag are enabled by default.

Diagnostic text:

error: call to undeclared function A; ISO C99 and later do not support implicit function declarations

warning: implicitly declaring library function ‘A’ with type B

error: call to undeclared library function ‘A’ with type B; ISO C99 and later do not support implicit function declarations

error: use of unknown builtin A

warning: implicit declaration of function A

-Wimplicit-int#

Some of the diagnostics controlled by this flag are enabled by default.

Diagnostic text:

error: type specifier missing, defaults to ‘int’; ISO C99 and later do not support implicit int

error: parameter A was not declared, defaults to ‘int’; ISO C99 and later do not support implicit int

warning: type specifier missing, defaults to ‘int’

-Wimplicit-int-conversion#

Also controls -Wimplicit-int-conversion-on-negation, -Wobjc-signed-char-bool-implicit-int-conversion, -Wshorten-64-to-32.

Diagnostic text:

warning: higher order bits are zeroes after implicit conversion

warning: implicit conversion loses integer precision: A to B

-Wimplicit-int-conversion-on-negation#

Diagnostic text:

warning: implicit conversion loses integer precision: A to B on negation

-Wimplicit-int-enum-cast#

Some of the diagnostics controlled by this flag are enabled by default.

Also controls -Wimplicit-enum-enum-cast.

Diagnostic text:

warning: implicit conversion from A to enumeration type B is invalid in C++

-Wimplicit-int-float-conversion#

Some of the diagnostics controlled by this flag are enabled by default.

Also controls -Wimplicit-const-int-float-conversion.

Diagnostic text:

warning: implicit conversion from A to B may lose precision

-Wimplicit-overflow-behavior-conversion#

Also controls -Wimplicit-overflow-behavior-conversion-assignment, -Wimplicit-overflow-behavior-conversion-assignment-pedantic, -Wimplicit-overflow-behavior-conversion-function-boundary, -Wimplicit-overflow-behavior-conversion-function-boundary-pedantic, -Wimplicit-overflow-behavior-conversion-pedantic.

Diagnostic text:

warning: implicit conversion from A to B discards overflow behavior

-Wimplicit-overflow-behavior-conversion-assignment#

Diagnostic text:

warning: implicit conversion from A to B during assignment discards overflow behavior

-Wimplicit-overflow-behavior-conversion-assignment-pedantic#

Diagnostic text:

warning: implicit conversion from A to B during assignment discards overflow behavior

-Wimplicit-overflow-behavior-conversion-function-boundary#

Diagnostic text:

warning: passing argument of type A to parameter of type B discards overflow behavior at function boundary

-Wimplicit-overflow-behavior-conversion-function-boundary-pedantic#

Diagnostic text:

warning: passing argument of type A to parameter of type B discards overflow behavior at function boundary

-Wimplicit-overflow-behavior-conversion-pedantic#

Diagnostic text:

warning: implicit conversion from A to B discards overflow behavior

-Wimplicit-retain-self#

Diagnostic text:

warning: block implicitly retains ‘self’; explicitly mention ‘self’ to indicate this is intended behavior

-Wimplicit-void-ptr-cast#

Diagnostic text:

warning: implicit conversion when 

assigning to A from type B

assigning to type from type

passing A to parameter of type B

passing type to parameter of type

returning A from a function with result type B

returning type from a function with result type

<CLANG BUG IF YOU SEE THIS>

initializing A with an expression of type B

initializing type with an expression of type

sending A to parameter of type B

sending type to parameter of type

<CLANG BUG IF YOU SEE THIS>

 is not permitted in C++

-Wimplicitly-unsigned-literal#

This diagnostic is enabled by default.

Diagnostic text:

warning: integer literal is too large to be represented in a signed integer type, interpreting as unsigned

-Wimport#

This diagnostic flag exists for GCC compatibility, and has no effect in Clang.

-Wimport-implementation-partition-unit-in-interface-unit#

This diagnostic is enabled by default.

Diagnostic text:

warning: importing an implementation partition unit in a module interface is not recommended. Names from A may not be reachable

-Wimport-preprocessor-directive-pedantic#

Diagnostic text:

warning: #import is a language extension

-Winaccessible-base#

This diagnostic is enabled by default.

Diagnostic text:

warning: direct base A is inaccessible due to ambiguity:B

-Winclude-angled-in-module-purview#

This diagnostic is enabled by default.

Diagnostic text:

warning: ‘#include <filename>’ attaches the declarations to the named module ‘A’, which is not usually intended; consider moving that directive before the module declaration

-Winclude-next-absolute-path#

This diagnostic is enabled by default.

Diagnostic text:

warning: #include_next in file found relative to primary source file or found by absolute path; will search from start of include path

-Winclude-next-outside-header#

This diagnostic is enabled by default.

Diagnostic text:

warning: #include_next in primary source file; will search from start of include path

-Wincompatible-exception-spec#

This diagnostic is enabled by default.

Diagnostic text:

warning: exception specifications of 

return

argument

 types differ

warning: target exception specification is not superset of source

-Wincompatible-function-pointer-types#

This diagnostic is an error by default, but the flag -Wno-incompatible-function-pointer-types can be used to disable the error.

Diagnostic text:

error: incompatible function pointer types 

assigning to A from B

assigning to different types

passing A to parameter of type B

passing to parameter of different type

returning A from a function with result type B

returning from function with different return type

converting A to type B

converting between types

initializing A with an expression of type B

initializing with expression of different type

sending A to parameter of type B

sending to parameter of different type

casting A to type B

casting between types

; dereference with *

; take the address with &

; remove *

; remove &

-Wincompatible-function-pointer-types-strict#

Diagnostic text:

warning: incompatible function pointer types 

assigning to A from B

assigning to different types

passing A to parameter of type B

passing to parameter of different type

returning A from a function with result type B

returning from function with different return type

converting A to type B

converting between types

initializing A with an expression of type B

initializing with expression of different type

sending A to parameter of type B

sending to parameter of different type

casting A to type B

casting between types

; dereference with *

; take the address with &

; remove *

; remove &

-Wincompatible-library-redeclaration#

This diagnostic is enabled by default.

Diagnostic text:

warning: incompatible redeclaration of library function A

-Wincompatible-ms-pragma-section#

This diagnostic is enabled by default.

Diagnostic text:

warning: `#pragma const_seg` for section B will not apply to A due to the presence of a 

mutable field

non-trivial constructor

non-trivial destructor

-Wincompatible-ms-struct#

This diagnostic is an error by default, but the flag -Wno-incompatible-ms-struct can be used to disable the error.

Diagnostic text:

error: ms_struct may not produce Microsoft-compatible layouts for classes with base classes or virtual functions

error: ms_struct may not produce Microsoft-compatible layouts with fundamental data types with sizes that aren’t a power of two

-Wincompatible-pointer-types#

This diagnostic is enabled by default.

Also controls -Wincompatible-function-pointer-types, -Wincompatible-pointer-types-discards-overflow-behavior, -Wincompatible-pointer-types-discards-qualifiers.

Diagnostic text:

error: incompatible pointer types 

assigning to A from B

assigning to different types

passing A to parameter of type B

passing to parameter of different type

returning A from a function with result type B

returning from function with different return type

converting A to type B

converting between types

initializing A with an expression of type B

initializing with expression of different type

sending A to parameter of type B

sending to parameter of different type

casting A to type B

casting between types

; dereference with *

; take the address with &

; remove *

; remove &

-Wincompatible-pointer-types-discards-overflow-behavior#

This diagnostic is enabled by default.

Diagnostic text:

warning: 

assigning to A from B

assigning to different types

passing A to parameter of type B

passing to parameter of different type

returning A from a function with result type B

returning from function with different return type

converting A to type B

converting between types

initializing A with an expression of type B

initializing with expression of different type

sending A to parameter of type B

sending to parameter of different type

casting A to type B

casting between types

 discards overflow behavior

-Wincompatible-pointer-types-discards-qualifiers#

This diagnostic is enabled by default.

Diagnostic text:

warning: 

assigning to A from B

assigning to different types

passing A to parameter of type B

passing to parameter of different type

returning A from a function with result type B

returning from function with different return type

converting A to type B

converting between types

initializing A with an expression of type B

initializing with expression of different type

sending A to parameter of type B

sending to parameter of different type

casting A to type B

casting between types

 discards qualifiers in nested pointer types

warning: 

assigning to A from B

assigning to different types

passing A to parameter of type B

passing to parameter of different type

returning A from a function with result type B

returning from function with different return type

converting A to type B

converting between types

initializing A with an expression of type B

initializing with expression of different type

sending A to parameter of type B

sending to parameter of different type

casting A to type B

casting between types

 discards qualifiers

warning: 

reinterpret_cast

C-style cast

 from B to C changes address space of nested pointers

-Wincompatible-property-type#

This diagnostic is enabled by default.

Diagnostic text:

warning: property type A is incompatible with type B inherited from C

-Wincompatible-sysroot#

This diagnostic is enabled by default.

Diagnostic text:

warning: using sysroot for ‘A’ but targeting ‘B’

-Wincomplete-framework-module-declaration#

This diagnostic is enabled by default.

Diagnostic text:

warning: skipping ‘A’ because module declaration of ‘B’ lacks the ‘framework’ qualifier

-Wincomplete-implementation#

This diagnostic is enabled by default.

Diagnostic text:

warning: method definition for A not found

-Wincomplete-module#

Some of the diagnostics controlled by this flag are enabled by default.

Controls -Wincomplete-umbrella, -Wnon-modular-include-in-module.

-Wincomplete-setjmp-declaration#

This diagnostic is enabled by default.

Diagnostic text:

warning: declaration of built-in function ‘A’ requires the declaration of the ‘jmp_buf’ type, commonly provided in the header <setjmp.h>

-Wincomplete-umbrella#

This diagnostic is enabled by default.

Diagnostic text:

warning: missing submodule ‘A’

warning: umbrella directory ‘A’ not found

warning: umbrella header for module ‘A’ does not include header ‘B’

-Winconsistent-dllimport#

This diagnostic is enabled by default.

Diagnostic text:

warning: A redeclared without B attribute: previous B ignored

warning: A redeclared without ‘dllimport’ attribute: ‘dllexport’ attribute added

-Winconsistent-missing-destructor-override#

Diagnostic text:

warning: A overrides a destructor but is not marked ‘override’

-Winconsistent-missing-override#

This diagnostic is enabled by default.

Diagnostic text:

warning: A overrides a member function but is not marked ‘override’

-Wincrement-bool#

This diagnostic is enabled by default.

Also controls -Wdeprecated-increment-bool.

Diagnostic text:

error: ISO C++17 does not allow incrementing expression of type bool

-Winfinite-recursion#

Diagnostic text:

warning: all paths through this function will call itself

-Winit-priority-reserved#

This diagnostic is an error by default, but the flag -Wno-init-priority-reserved can be used to disable the error.

Diagnostic text:

error: requested ‘init_priority’ A is reserved for internal use

-Winit-self#

This diagnostic flag exists for GCC compatibility, and has no effect in Clang.

-Winitializer-overrides#

This diagnostic is enabled by default.

Diagnostic text:

warning: initializer 

partially 

overrides prior initialization of this subobject

error: initializer 

partially 

overrides prior initialization of this subobject

warning: initializer 

partially 

overrides prior initialization of this subobject

-Winjected-class-name#

This diagnostic is enabled by default.

Diagnostic text:

warning: ISO C++ specifies that qualified reference to A is a constructor name rather than a 

template name

type

 in this context, despite preceding 

‘typename’

‘template’

 keyword

-Winline#

This diagnostic flag exists for GCC compatibility, and has no effect in Clang.

-Winline-asm#

This diagnostic is enabled by default.

Diagnostic text:

The text of this diagnostic is not controlled by Clang.

-Winline-namespace-reopened-noninline#

This diagnostic is enabled by default.

Diagnostic text:

warning: inline namespace reopened as a non-inline namespace

-Winline-new-delete#

This diagnostic is enabled by default.

Diagnostic text:

warning: replacement function A cannot be declared ‘inline’

-Winstallapi-violation#

This diagnostic is enabled by default.

Diagnostic text:

warning: dynamic library symbol ‘A’ is 

weak defined

thread local

, but its declaration is not

warning: glob ‘A’ did not match any header file

warning: declaration ‘A’ is marked 

available

unavailable

, but symbol is 

not 

exported in dynamic library

warning: symbol exported in dynamic library, but marked hidden in declaration ‘A’

warning: declaration ‘A’ is 

weak defined

thread local

, but symbol is not in dynamic library

warning: no declaration was found for exported symbol ‘A’ in dynamic library

warning: declaration has external linkage, but symbol has internal linkage in dynamic library ‘A’

warning: declaration has external linkage, but dynamic library doesn’t have symbol ‘A’

warning: no such excluded 

public

private

 header file: ‘B’

warning: platform does not match: ‘A’ (provided) vs ‘B’ (found)

warning: runpath search paths do not match: ‘A’ (provided) vs ‘B’ (found)

warning: runpath search paths missing from A: ‘B’

warning: violations found for A

-Winstantiation-after-specialization#

This diagnostic is enabled by default.

Diagnostic text:

warning: explicit instantiation of A that occurs after an explicit specialization has no effect

-Wint-conversion#

This diagnostic is an error by default, but the flag -Wno-int-conversion can be used to disable the error.

Diagnostic text:

error: incompatible integer to pointer conversion 

assigning to A from B

assigning to different types

passing A to parameter of type B

passing to parameter of different type

returning A from a function with result type B

returning from function with different return type

converting A to type B

converting between types

initializing A with an expression of type B

initializing with expression of different type

sending A to parameter of type B

sending to parameter of different type

casting A to type B

casting between types

; dereference with *

; take the address with &

; remove *

; remove &

error: incompatible pointer to integer conversion 

assigning to A from B

assigning to different types

passing A to parameter of type B

passing to parameter of different type

returning A from a function with result type B

returning from function with different return type

converting A to type B

converting between types

initializing A with an expression of type B

initializing with expression of different type

sending A to parameter of type B

sending to parameter of different type

casting A to type B

casting between types

; dereference with *

; take the address with &

; remove *

; remove &

-Wint-conversions#