Index: vendor/clang/dist-release_70/docs/DiagnosticsReference.rst =================================================================== --- vendor/clang/dist-release_70/docs/DiagnosticsReference.rst (revision 338576) +++ vendor/clang/dist-release_70/docs/DiagnosticsReference.rst (revision 338577) @@ -1,11588 +1,11972 @@ .. ------------------------------------------------------------------- NOTE: This file is automatically generated by running clang-tblgen -gen-diag-docs. Do not edit this file by hand!! ------------------------------------------------------------------- .. Add custom CSS to output. FIXME: This should be put into rather than the start of . .. raw:: html .. FIXME: rST doesn't support formatting this, so we format all elements as monospace font face instead. .. |nbsp| unicode:: 0xA0 :trim: .. Roles generated by clang-tblgen. .. role:: error .. role:: warning .. role:: remark .. role:: diagtext .. role:: placeholder(emphasis) ========================= Diagnostic flags in Clang ========================= .. contents:: :local: 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:`warning:` |nbsp| :diagtext:`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:`warning:` |nbsp| :diagtext:`'objc\_independent\_class' attribute may be put on a typedef only; attribute is ignored`| +------------------------------------------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'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:`warning:` |nbsp| :diagtext:`'NSObject' attribute may be put on a typedef only; attribute is ignored`| +--------------------------------------------------------------------------------------------------------------+ -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:`warning:` |nbsp| :diagtext:`absolute value function` |nbsp| :placeholder:`A` |nbsp| :diagtext:`given an argument of type` |nbsp| :placeholder:`B` |nbsp| :diagtext:`but has parameter of type` |nbsp| :placeholder:`C` |nbsp| :diagtext:`which may cause truncation of value`| +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`taking the absolute value of` |nbsp| |+--------------------+| |nbsp| :diagtext:`type` |nbsp| :placeholder:`B` |nbsp| :diagtext:`is suspicious`| | ||:diagtext:`pointer` || | | |+--------------------+| | | ||:diagtext:`function`|| | | |+--------------------+| | | ||:diagtext:`array` || | | |+--------------------+| | +---------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`taking the absolute value of unsigned type` |nbsp| :placeholder:`A` |nbsp| :diagtext:`has no effect`| +------------------------------------------------------------------------------------------------------------------------------------------+ +----------------------------------------------------+----------------------------+------------------------------------------------------------------------------------------------------------------+----------------------------+------------------------+ |:warning:`warning:` |nbsp| :diagtext:`using` |nbsp| |+--------------------------+| |nbsp| :diagtext:`absolute value function` |nbsp| :placeholder:`A` |nbsp| :diagtext:`when argument is of` |nbsp| |+--------------------------+| |nbsp| :diagtext:`type`| | ||:diagtext:`integer` || ||:diagtext:`integer` || | | |+--------------------------+| |+--------------------------+| | | ||:diagtext:`floating point`|| ||:diagtext:`floating point`|| | | |+--------------------------+| |+--------------------------+| | | ||:diagtext:`complex` || ||:diagtext:`complex` || | | |+--------------------------+| |+--------------------------+| | +----------------------------------------------------+----------------------------+------------------------------------------------------------------------------------------------------------------+----------------------------+------------------------+ -Wabstract-final-class ---------------------- This diagnostic is enabled by default. **Diagnostic text:** +-----------------------------------------------------------------+--------------------+-------------+ |:warning:`warning:` |nbsp| :diagtext:`abstract class is marked '`|+------------------+|:diagtext:`'`| | ||:diagtext:`final` || | | |+------------------+| | | ||:diagtext:`sealed`|| | | |+------------------+| | +-----------------------------------------------------------------+--------------------+-------------+ -Wabstract-vbase-init --------------------- **Diagnostic text:** +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`initializer for virtual base class` |nbsp| :placeholder:`A` |nbsp| :diagtext:`of abstract class` |nbsp| :placeholder:`B` |nbsp| :diagtext:`will never be used`| +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Waddress --------- This diagnostic is enabled by default. Controls `-Wpointer-bool-conversion`_, `-Wstring-compare`_, `-Wtautological-pointer-compare`_. --Waddress-of-array-temporary ----------------------------- -This diagnostic is enabled by default. - -**Diagnostic text:** - -+---------------------------------------------------------------------------------------------------------------------------------------------+ -|:warning:`warning:` |nbsp| :diagtext:`pointer is initialized by a temporary array, which will be destroyed at the end of the full-expression`| -+---------------------------------------------------------------------------------------------------------------------------------------------+ - - -Waddress-of-packed-member -------------------------- This diagnostic is enabled by default. **Diagnostic text:** +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`taking address of packed member` |nbsp| :placeholder:`A` |nbsp| :diagtext:`of class or structure` |nbsp| :placeholder:`B` |nbsp| :diagtext:`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:`error:` |nbsp| :diagtext:`taking the address of a temporary object of type` |nbsp| :placeholder:`A`| +-----------------------------------------------------------------------------------------------------------+ -Waggregate-return ------------------ This diagnostic flag exists for GCC compatibility, and has no effect in Clang. --Waligned-allocation-unavailable --------------------------------- -This diagnostic is an error by default, but the flag ``-Wno-aligned-allocation-unavailable`` can be used to disable the error. - -**Diagnostic text:** - -+--------------------------------------------------+--------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -|:error:`error:` |nbsp| :diagtext:`aligned` |nbsp| |+------------------------+| |nbsp| :diagtext:`function of type '`:placeholder:`B`:diagtext:`' is only available on` |nbsp| :placeholder:`C` |nbsp| :placeholder:`D` |nbsp| :diagtext:`or newer`| -| ||:diagtext:`allocation` || | -| |+------------------------+| | -| ||:diagtext:`deallocation`|| | -| |+------------------------+| | -+--------------------------------------------------+--------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - - -Wall ----- Some of the diagnostics controlled by this flag are enabled by default. Controls `-Wmost`_, `-Wparentheses`_, `-Wswitch`_, `-Wswitch-bool`_. -Walloca-with-align-alignof --------------------------- This diagnostic is enabled by default. **Diagnostic text:** +--------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`second argument to \_\_builtin\_alloca\_with\_align is supposed to be in bits`| +--------------------------------------------------------------------------------------------------------------------+ -Wambiguous-delete ------------------ This diagnostic is enabled by default. **Diagnostic text:** +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`multiple suitable` |nbsp| :placeholder:`A` |nbsp| :diagtext:`functions for` |nbsp| :placeholder:`B`:diagtext:`; no 'operator delete' function will be invoked if initialization throws an exception`| +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wambiguous-ellipsis -------------------- This diagnostic is enabled by default. **Diagnostic text:** +------------------------------------------------------------------------------------------------+---------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'...' in this location creates a C-style varargs function`|+-------------------------------------------+| | ||:diagtext:`, not a function parameter pack`|| | |+-------------------------------------------+| | || || | |+-------------------------------------------+| +------------------------------------------------------------------------------------------------+---------------------------------------------+ -Wambiguous-macro ----------------- This diagnostic is enabled by default. **Diagnostic text:** +-------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`ambiguous expansion of macro` |nbsp| :placeholder:`A`| +-------------------------------------------------------------------------------------------+ -Wambiguous-member-template --------------------------- This diagnostic is enabled by default. **Diagnostic text:** +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`lookup of` |nbsp| :placeholder:`A` |nbsp| :diagtext:`in member access expression is ambiguous; using member of` |nbsp| :placeholder:`B`| +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wanalyzer-incompatible-plugin ------------------------------ This diagnostic is enabled by default. **Diagnostic text:** +----------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`checker plugin '`:placeholder:`A`:diagtext:`' is not compatible with this version of the analyzer`| +----------------------------------------------------------------------------------------------------------------------------------------+ -Wanonymous-pack-parens ----------------------- This diagnostic is enabled by default. **Diagnostic text:** +---------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`ISO C++11 requires a parenthesized pack declaration to have a name`| +---------------------------------------------------------------------------------------------------------+ -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:`warning:` |nbsp| :diagtext:`'`:placeholder:`A`:diagtext:`' casts have no effect when not using ARC`| +-------------------------------------------------------------------------------------------------------------+ -Warc-maybe-repeated-use-of-weak -------------------------------- **Diagnostic text:** +---------------------------------------------------+-------------------------------+------------------------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`weak` |nbsp| |+-----------------------------+| |nbsp| :placeholder:`B` |nbsp| :diagtext:`may be accessed multiple times in this` |nbsp| |+--------------------+| |nbsp| :diagtext:`and may be unpredictably set to nil; assign to a strong variable to keep the object alive`| | ||:diagtext:`variable` || ||:diagtext:`function`|| | | |+-----------------------------+| |+--------------------+| | | ||:diagtext:`property` || ||:diagtext:`method` || | | |+-----------------------------+| |+--------------------+| | | ||:diagtext:`implicit property`|| ||:diagtext:`block` || | | |+-----------------------------+| |+--------------------+| | | ||:diagtext:`instance variable`|| ||:diagtext:`lambda` || | | |+-----------------------------+| |+--------------------+| | +---------------------------------------------------+-------------------------------+------------------------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------------------------------------------+ -Warc-non-pod-memaccess ----------------------- This diagnostic is enabled by default. **Diagnostic text:** +---------------------------+-----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| |+---------------------------+| |nbsp| :diagtext:`this` |nbsp| :placeholder:`B` |nbsp| :diagtext:`call is a pointer to ownership-qualified type` |nbsp| :placeholder:`C`| | ||:diagtext:`destination for`|| | | |+---------------------------+| | | ||:diagtext:`source of` || | | |+---------------------------+| | +---------------------------+-----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ -Warc-performSelector-leaks --------------------------- This diagnostic is enabled by default. **Diagnostic text:** +-------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`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:`warning:` |nbsp| :diagtext:`weak` |nbsp| |+-----------------------------+| |nbsp| :placeholder:`B` |nbsp| :diagtext:`is accessed multiple times in this` |nbsp| |+--------------------+| |nbsp| :diagtext:`but may be unpredictably set to nil; assign to a strong variable to keep the object alive`| | ||:diagtext:`variable` || ||:diagtext:`function`|| | | |+-----------------------------+| |+--------------------+| | | ||:diagtext:`property` || ||:diagtext:`method` || | | |+-----------------------------+| |+--------------------+| | | ||:diagtext:`implicit property`|| ||:diagtext:`block` || | | |+-----------------------------+| |+--------------------+| | | ||:diagtext:`instance variable`|| ||:diagtext:`lambda` || | | |+-----------------------------+| |+--------------------+| | +---------------------------------------------------+-------------------------------+--------------------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------------------------------------------+ -Warc-retain-cycles ------------------- This diagnostic is enabled by default. **Diagnostic text:** +------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`capturing` |nbsp| :placeholder:`A` |nbsp| :diagtext:`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:`warning:` |nbsp| :diagtext:`assigning` |nbsp| |+-------------------------------+| |nbsp| :diagtext:`to a weak` |nbsp| |+--------------------+|:diagtext:`; object will be released after assignment`| | ||:diagtext:`array literal` || ||:diagtext:`property`|| | | |+-------------------------------+| |+--------------------+| | | ||:diagtext:`dictionary literal` || ||:diagtext:`variable`|| | | |+-------------------------------+| |+--------------------+| | | ||:diagtext:`numeric literal` || | | | | |+-------------------------------+| | | | | ||:diagtext:`boxed expression` || | | | | |+-------------------------------+| | | | | ||:diagtext:``|| | | | | |+-------------------------------+| | | | | ||:diagtext:`block literal` || | | | | |+-------------------------------+| | | | +--------------------------------------------------------+---------------------------------+-------------------------------------+----------------------+------------------------------------------------------+ +---------------------------------------------------------------------------+--------------------------------+--------+----------------------+------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`assigning retained object to` |nbsp| |+------------------------------+| |nbsp| |+--------------------+|:diagtext:`; object will be released after assignment`| | ||:diagtext:`weak` || ||:diagtext:`property`|| | | |+------------------------------+| |+--------------------+| | | ||:diagtext:`unsafe\_unretained`|| ||:diagtext:`variable`|| | | |+------------------------------+| |+--------------------+| | +---------------------------------------------------------------------------+--------------------------------+--------+----------------------+------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`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:`error:` |nbsp| :diagtext:`argument value` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is outside the valid range \[`:placeholder:`B`:diagtext:`,` |nbsp| :placeholder:`C`:diagtext:`\]`| ++---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + + -Warray-bounds -------------- This diagnostic is enabled by default. **Diagnostic text:** +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------+-------------+ |:warning:`warning:` |nbsp| :diagtext:`array index` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is past the end of the array (which contains` |nbsp| :placeholder:`B` |nbsp| :diagtext:`element`|+-------------+|:diagtext:`)`| | || || | | |+-------------+| | | ||:diagtext:`s`|| | | |+-------------+| | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------+-------------+ +----------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`array index` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is before the beginning of the array`| +----------------------------------------------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`array argument is too small; contains` |nbsp| :placeholder:`A` |nbsp| :diagtext:`elements, callee requires at least` |nbsp| :placeholder:`B`| +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'static' has no effect on zero-length arrays`| +-----------------------------------------------------------------------------------+ -Warray-bounds-pointer-arithmetic --------------------------------- **Diagnostic text:** +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------+-------------+ |:warning:`warning:` |nbsp| :diagtext:`the pointer incremented by` |nbsp| :placeholder:`A` |nbsp| :diagtext:`refers past the end of the array (that contains` |nbsp| :placeholder:`B` |nbsp| :diagtext:`element`|+-------------+|:diagtext:`)`| | || || | | |+-------------+| | | ||:diagtext:`s`|| | | |+-------------+| | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------+-------------+ +-----------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`the pointer decremented by` |nbsp| :placeholder:`A` |nbsp| :diagtext:`refers before the beginning of the array`| +-----------------------------------------------------------------------------------------------------------------------------------------------------+ -Wasm ----- This diagnostic is enabled by default. Controls `-Wasm-ignored-qualifier`_, `-Wasm-operand-widths`_. -Wasm-ignored-qualifier ----------------------- This diagnostic is enabled by default. **Diagnostic text:** +----------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`ignored` |nbsp| :placeholder:`A` |nbsp| :diagtext:`qualifier on asm`| +----------------------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`meaningless 'volatile' on asm outside function`| +-------------------------------------------------------------------------------------+ -Wasm-operand-widths -------------------- This diagnostic is enabled by default. **Diagnostic text:** +-----------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`value size does not match register size specified by the constraint and modifier`| +-----------------------------------------------------------------------------------------------------------------------+ -Wassign-enum ------------- **Diagnostic text:** +---------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`integer constant not in range of enumerated type` |nbsp| :placeholder:`A`| +---------------------------------------------------------------------------------------------------------------+ -Wassume -------- This diagnostic is enabled by default. **Diagnostic text:** +-----------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`the argument to` |nbsp| :placeholder:`A` |nbsp| :diagtext:`has side effects that will be discarded`| +-----------------------------------------------------------------------------------------------------------------------------------------+ -Wat-protocol ------------- This diagnostic is enabled by default. **Diagnostic text:** +-------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`@protocol is using a forward protocol declaration of` |nbsp| :placeholder:`A`| +-------------------------------------------------------------------------------------------------------------------+ +-Watimport-in-framework-header +------------------------------ +This diagnostic is enabled by default. + +**Diagnostic text:** + ++------------------------------------------------------------------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`use of '@import' in framework header is discouraged, including this header requires -fmodules`| ++------------------------------------------------------------------------------------------------------------------------------------+ + + +-Watomic-alignment +------------------ +This diagnostic is enabled by default. + +**Diagnostic text:** + ++---------------------------------------------------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`misaligned or large atomic operation may incur significant performance penalty`| ++---------------------------------------------------------------------------------------------------------------------+ + + -Watomic-memory-ordering ------------------------ This diagnostic is enabled by default. **Diagnostic text:** +-------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`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:`warning:` |nbsp| :diagtext:`writable atomic property` |nbsp| :placeholder:`A` |nbsp| :diagtext:`cannot pair a synthesized` |nbsp| |+------------------+| |nbsp| :diagtext:`with a user defined` |nbsp| |+------------------+| | ||:diagtext:`getter`|| ||:diagtext:`getter`|| | |+------------------+| |+------------------+| | ||:diagtext:`setter`|| ||:diagtext:`setter`|| | |+------------------+| |+------------------+| +--------------------------------------------------------------------------------------------------------------------------------------------+--------------------+-----------------------------------------------+--------------------+ -Wattribute-packed-for-bitfield ------------------------------- This diagnostic is enabled by default. **Diagnostic text:** +-------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'packed' attribute was ignored on bit-fields with single-byte alignment in older versions of GCC and Clang`| +-------------------------------------------------------------------------------------------------------------------------------------------------+ -Wattributes ------------ This diagnostic is enabled by default. Controls `-Wignored-attributes`_, `-Wunknown-attributes`_. -Wauto-disable-vptr-sanitizer ----------------------------- This diagnostic is enabled by default. **Diagnostic text:** +------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`implicitly disabling vptr sanitizer because rtti wasn't enabled`| +------------------------------------------------------------------------------------------------------+ -Wauto-import ------------- **Diagnostic text:** +-------------------------------------------------+---------------------------------+-------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`treating #`|+-------------------------------+| |nbsp| :diagtext:`as an import of module '`:placeholder:`B`:diagtext:`'`| | ||:diagtext:`include` || | | |+-------------------------------+| | | ||:diagtext:`import` || | | |+-------------------------------+| | | ||:diagtext:`include\_next` || | | |+-------------------------------+| | | ||:diagtext:`\_\_include\_macros`|| | | |+-------------------------------+| | +-------------------------------------------------+---------------------------------+-------------------------------------------------------------------------+ -Wauto-storage-class -------------------- This diagnostic is enabled by default. **Diagnostic text:** +---------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'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:`warning:` |nbsp| :diagtext:`'auto' deduced as 'id' in declaration of` |nbsp| :placeholder:`A`| +-------------------------------------------------------------------------------------------------------+ -Wavailability -------------- This diagnostic is enabled by default. **Diagnostic text:** +--------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'unavailable' availability overrides all other availability information`| +--------------------------------------------------------------------------------------------------------------+ ++------------------------------------------------------------------------------+----------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`ignoring availability attribute` |nbsp| |+--------------------------------------+| +| ||:diagtext:`on '+load' method` || +| |+--------------------------------------+| +| ||:diagtext:`with constructor attribute`|| +| |+--------------------------------------+| +| ||:diagtext:`with destructor attribute` || +| |+--------------------------------------+| ++------------------------------------------------------------------------------+----------------------------------------+ + +------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`unknown platform` |nbsp| :placeholder:`A` |nbsp| :diagtext:`in availability macro`| +------------------------------------------------------------------------------------------------------------------------+ +----------------------------------------------------------------+------------------------+------------------------------------------------------------------------------------------------------------------------------------------+------------------------+-------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`feature cannot be` |nbsp| |+----------------------+| |nbsp| :diagtext:`in` |nbsp| :placeholder:`B` |nbsp| :diagtext:`version` |nbsp| :placeholder:`C` |nbsp| :diagtext:`before it was` |nbsp| |+----------------------+| |nbsp| :diagtext:`in version` |nbsp| :placeholder:`E`:diagtext:`; attribute ignored`| | ||:diagtext:`introduced`|| ||:diagtext:`introduced`|| | | |+----------------------+| |+----------------------+| | | ||:diagtext:`deprecated`|| ||:diagtext:`deprecated`|| | | |+----------------------+| |+----------------------+| | | ||:diagtext:`obsoleted` || ||:diagtext:`obsoleted` || | | |+----------------------+| |+----------------------+| | +----------------------------------------------------------------+------------------------+------------------------------------------------------------------------------------------------------------------------------------------+------------------------+-------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`use same version number separators '\_' or '.'; as in 'major\[.minor\[.subminor\]\]'`| +---------------------------------------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`availability does not match previous declaration`| +---------------------------------------------------------------------------------------+ +---------------------------+--------------------------------+--------------------------+-------------------------------+--------+-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| |+------------------------------+|:diagtext:`method` |nbsp| |+-----------------------------+| |nbsp| |+---------------------------------------------+| |nbsp| :diagtext:`on` |nbsp| :placeholder:`B` |nbsp| :diagtext:`(`:placeholder:`C` |nbsp| :diagtext:`vs.` |nbsp| :placeholder:`D`:diagtext:`)`| | || || ||:diagtext:`introduced after` || ||:diagtext:`the protocol method it implements`|| | | |+------------------------------+| |+-----------------------------+| |+---------------------------------------------+| | | ||:diagtext:`overriding` |nbsp| || ||:diagtext:`deprecated before`|| ||:diagtext:`overridden method` || | | |+------------------------------+| |+-----------------------------+| |+---------------------------------------------+| | | | | ||:diagtext:`obsoleted before` || | | | | | | |+-----------------------------+| | | | +---------------------------+--------------------------------+--------------------------+-------------------------------+--------+-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+ +---------------------------+--------------------------------+---------------------------------------------------------------------------------------------------+-----------------------------------------------+--------------------------------+ |:warning:`warning:` |nbsp| |+------------------------------+|:diagtext:`method cannot be unavailable on` |nbsp| :placeholder:`A` |nbsp| :diagtext:`when` |nbsp| |+---------------------------------------------+| |nbsp| :diagtext:`is available`| | || || ||:diagtext:`the protocol method it implements`|| | | |+------------------------------+| |+---------------------------------------------+| | | ||:diagtext:`overriding` |nbsp| || ||:diagtext:`its overridden method` || | | |+------------------------------+| |+---------------------------------------------+| | +---------------------------+--------------------------------+---------------------------------------------------------------------------------------------------+-----------------------------------------------+--------------------------------+ -Wbackend-plugin ---------------- This diagnostic is enabled by default. **Diagnostic text:** The text of this diagnostic is not controlled by Clang. -Wbackslash-newline-escape -------------------------- This diagnostic is enabled by default. **Diagnostic text:** +-------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`backslash and newline separated by space`| +-------------------------------------------------------------------------------+ -Wbad-function-cast ------------------- **Diagnostic text:** +--------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`cast from function call of type` |nbsp| :placeholder:`A` |nbsp| :diagtext:`to non-matching type` |nbsp| :placeholder:`B`| +--------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wbinary-literal ---------------- Controls `-Wc++14-binary-literal`_, `-Wc++98-c++11-compat-binary-literal`_, `-Wgnu-binary-literal`_. -Wbind-to-temporary-copy ------------------------ Also controls `-Wc++98-compat-bind-to-temporary-copy`_. **Diagnostic text:** +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------+ |:warning:`warning:` |nbsp| :diagtext:`C++98 requires an accessible copy constructor for class` |nbsp| :placeholder:`C` |nbsp| :diagtext:`when binding a reference to a temporary; was` |nbsp| |+---------------------+| | ||:diagtext:`private` || | |+---------------------+| | ||:diagtext:`protected`|| | |+---------------------+| +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------+ -+--------------------------------------------------------------------+-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------+ -|:warning:`warning:` |nbsp| :diagtext:`no viable constructor` |nbsp| |+---------------------------------------+| |nbsp| :diagtext:`of type` |nbsp| :placeholder:`B`:diagtext:`; C++98 requires a copy constructor when binding a reference to a temporary`| -| ||:diagtext:`copying variable` || | -| |+---------------------------------------+| | -| ||:diagtext:`copying parameter` || | -| |+---------------------------------------+| | -| ||:diagtext:`returning object` || | -| |+---------------------------------------+| | -| ||:diagtext:`throwing object` || | -| |+---------------------------------------+| | -| ||:diagtext:`copying member subobject` || | -| |+---------------------------------------+| | -| ||:diagtext:`copying array element` || | -| |+---------------------------------------+| | -| ||:diagtext:`allocating object` || | -| |+---------------------------------------+| | -| ||:diagtext:`copying temporary` || | -| |+---------------------------------------+| | -| ||:diagtext:`initializing base subobject`|| | -| |+---------------------------------------+| | -| ||:diagtext:`initializing vector element`|| | -| |+---------------------------------------+| | -| ||:diagtext:`capturing value` || | -| |+---------------------------------------+| | -+--------------------------------------------------------------------+-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------+ ++--------------------------------------------------------------------+------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`no viable constructor` |nbsp| |+----------------------------------------------------+| |nbsp| :diagtext:`of type` |nbsp| :placeholder:`B`:diagtext:`; C++98 requires a copy constructor when binding a reference to a temporary`| +| ||:diagtext:`copying variable` || | +| |+----------------------------------------------------+| | +| ||:diagtext:`copying parameter` || | +| |+----------------------------------------------------+| | +| ||:diagtext:`returning object` || | +| |+----------------------------------------------------+| | +| ||:diagtext:`initializing statement expression result`|| | +| |+----------------------------------------------------+| | +| ||:diagtext:`throwing object` || | +| |+----------------------------------------------------+| | +| ||:diagtext:`copying member subobject` || | +| |+----------------------------------------------------+| | +| ||:diagtext:`copying array element` || | +| |+----------------------------------------------------+| | +| ||:diagtext:`allocating object` || | +| |+----------------------------------------------------+| | +| ||:diagtext:`copying temporary` || | +| |+----------------------------------------------------+| | +| ||:diagtext:`initializing base subobject` || | +| |+----------------------------------------------------+| | +| ||:diagtext:`initializing vector element` || | +| |+----------------------------------------------------+| | +| ||:diagtext:`capturing value` || | +| |+----------------------------------------------------+| | ++--------------------------------------------------------------------+------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------+ +-Wbinding-in-condition +---------------------- +This diagnostic is enabled by default. + +**Diagnostic text:** + ++--------------------------------------------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`ISO C++17 does not permit structured binding declaration in a condition`| ++--------------------------------------------------------------------------------------------------------------+ + + -Wbitfield-constant-conversion ------------------------------ This diagnostic is enabled by default. **Diagnostic text:** +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`implicit truncation from` |nbsp| :placeholder:`C` |nbsp| :diagtext:`to bit-field changes value from` |nbsp| :placeholder:`A` |nbsp| :diagtext:`to` |nbsp| :placeholder:`B`| +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wbitfield-enum-conversion -------------------------- **Diagnostic text:** +------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`bit-field` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is not wide enough to store all enumerators of` |nbsp| :placeholder:`B`| +------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`signed bit-field` |nbsp| :placeholder:`A` |nbsp| :diagtext:`needs an extra bit to represent the largest positive enumerators of` |nbsp| :placeholder:`B`| +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`assigning value of signed enum type` |nbsp| :placeholder:`B` |nbsp| :diagtext:`to unsigned bit-field` |nbsp| :placeholder:`A`:diagtext:`; negative enumerators of enum` |nbsp| :placeholder:`B` |nbsp| :diagtext:`will be converted to positive values`| +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wbitfield-width ---------------- This diagnostic is enabled by default. **Diagnostic text:** +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------+ |:warning:`warning:` |nbsp| :diagtext:`width of anonymous bit-field (`:placeholder:`A` |nbsp| :diagtext:`bits) exceeds width of its type; value will be truncated to` |nbsp| :placeholder:`B` |nbsp| :diagtext:`bit`|+-------------+| | || || | |+-------------+| | ||:diagtext:`s`|| | |+-------------+| +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------+ +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------+ |:warning:`warning:` |nbsp| :diagtext:`width of bit-field` |nbsp| :placeholder:`A` |nbsp| :diagtext:`(`:placeholder:`B` |nbsp| :diagtext:`bits) exceeds the width of its type; value will be truncated to` |nbsp| :placeholder:`C` |nbsp| :diagtext:`bit`|+-------------+| | || || | |+-------------+| | ||:diagtext:`s`|| | |+-------------+| +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------+ -Wbitwise-op-parentheses ------------------------ This diagnostic is enabled by default. **Diagnostic text:** +-----------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'`:placeholder:`A`:diagtext:`' within '`:placeholder:`B`:diagtext:`'`| +-----------------------------------------------------------------------------------------------------------+ -Wblock-capture-autoreleasing ----------------------------- This diagnostic is enabled by default. **Diagnostic text:** +-----------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`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:`warning:` |nbsp| :diagtext:`initialization of pointer of type` |nbsp| :placeholder:`A` |nbsp| :diagtext:`to null from a constant boolean expression`| +--------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wbool-conversions ------------------ Synonym for `-Wbool-conversion`_. -Wbraced-scalar-init -------------------- This diagnostic is enabled by default. **Diagnostic text:** +-----------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`braces around scalar initializer`| +-----------------------------------------------------------------------+ -Wbridge-cast ------------- This diagnostic is enabled by default. **Diagnostic text:** +------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`bridges to` |nbsp| :placeholder:`B`:diagtext:`, not` |nbsp| :placeholder:`C`| +------------------------------------------------------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`cannot bridge to` |nbsp| :placeholder:`B`| +-------------------------------------------------------------------------------------------------------+ -Wbuiltin-macro-redefined ------------------------- This diagnostic is enabled by default. **Diagnostic text:** +---------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`redefining builtin macro`| +---------------------------------------------------------------+ +---------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`undefining builtin macro`| +---------------------------------------------------------------+ -Wbuiltin-memcpy-chk-size ------------------------- This diagnostic is enabled by default. **Diagnostic text:** +------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`will always overflow destination buffer`| +------------------------------------------------------------------------------------------------------+ -Wbuiltin-requires-header ------------------------- This diagnostic is enabled by default. **Diagnostic text:** +----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`declaration of built-in function '`:placeholder:`B`:diagtext:`' requires inclusion of the header <`:placeholder:`A`:diagtext:`>`| +----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wc++-compat ------------ **Diagnostic text:** +---------------------------+---------------------------+--------------------+--------------------------------------------+---------------------------+--------------------------+ |:warning:`warning:` |nbsp| |+-------------------------+|+------------------+| |nbsp| :diagtext:`has size 0 in C,` |nbsp| |+-------------------------+| |nbsp| :diagtext:`in C++`| | || |||:diagtext:`struct`|| ||:diagtext:`size 1` || | | |+-------------------------+|+------------------+| |+-------------------------+| | | ||:diagtext:`empty` |nbsp| |||:diagtext:`union` || ||:diagtext:`non-zero size`|| | | |+-------------------------+|+------------------+| |+-------------------------+| | +---------------------------+---------------------------+--------------------+--------------------------------------------+---------------------------+--------------------------+ -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`_, `-Wc++98-c++11-c++14-c++17-compat`_, `-Wc++98-c++11-c++14-compat`_, `-Wc++98-c++11-compat`_. **Diagnostic text:** +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------+------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`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` |nbsp| |+---------------------------------+| |nbsp| :diagtext:`in C++11 onwards`| | ||:diagtext:`have type 'long long'`|| | | |+---------------------------------+| | | ||:diagtext:`be ill-formed` || | | |+---------------------------------+| | +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------+------------------------------------+ +--------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'auto' storage class specifier is redundant and incompatible with C++11`| +--------------------------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`identifier after literal will be treated as a user-defined literal suffix in C++11`| +-------------------------------------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'`:placeholder:`A`:diagtext:`' is a keyword in C++11`| +-------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`use of right-shift operator ('>>') in template argument will require parentheses in C++11`| +--------------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`explicit instantiation cannot be 'inline'`| +--------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`explicit instantiation of` |nbsp| :placeholder:`A` |nbsp| :diagtext:`must occur at global scope`| +--------------------------------------------------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`explicit instantiation of` |nbsp| :placeholder:`A` |nbsp| :diagtext:`not in a namespace enclosing` |nbsp| :placeholder:`B`| +----------------------------------------------------------------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`explicit instantiation of` |nbsp| :placeholder:`A` |nbsp| :diagtext:`must occur in namespace` |nbsp| :placeholder:`B`| +-----------------------------------------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------+------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`integer literal is too large to be represented in type 'long', interpreting as 'unsigned long' per C++98; this literal will` |nbsp| |+---------------------------------+| |nbsp| :diagtext:`in C++11 onwards`| | ||:diagtext:`have type 'long long'`|| | | |+---------------------------------+| | | ||:diagtext:`be ill-formed` || | | |+---------------------------------+| | +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------+------------------------------------+ -Wc++11-compat-deprecated-writable-strings ------------------------------------------ This diagnostic is enabled by default. **Diagnostic text:** +---------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`conversion from string literal to` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is deprecated`| +---------------------------------------------------------------------------------------------------------------------------------+ -Wc++11-compat-pedantic ----------------------- Some of the diagnostics controlled by this flag are enabled by default. Controls `-Wc++11-compat`_, `-Wc++98-c++11-c++14-c++17-compat-pedantic`_, `-Wc++98-c++11-c++14-compat-pedantic`_, `-Wc++98-c++11-compat-pedantic`_. -Wc++11-compat-reserved-user-defined-literal -------------------------------------------- **Diagnostic text:** +----------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`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:`warning:` |nbsp| :diagtext:`alias declarations are a C++11 extension`| +-------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------+----------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`implicit conversion from array size expression of type` |nbsp| :placeholder:`A` |nbsp| :diagtext:`to` |nbsp| |+-----------------------+| |nbsp| :diagtext:`type` |nbsp| :placeholder:`C` |nbsp| :diagtext:`is a C++11 extension`| | ||:diagtext:`integral` || | | |+-----------------------+| | | ||:diagtext:`enumeration`|| | | |+-----------------------+| | +---------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------+----------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'auto' type specifier is a C++11 extension`| +---------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`enumeration types with a fixed underlying type are a C++11 extension`| +-----------------------------------------------------------------------------------------------------------+ +---------------------------+-----------------------+--------------------------------------------------------------+ |:warning:`warning:` |nbsp| |+---------------------+| |nbsp| :diagtext:`function definitions are a C++11 extension`| | ||:diagtext:`defaulted`|| | | |+---------------------+| | | ||:diagtext:`deleted` || | | |+---------------------+| | +---------------------------+-----------------------+--------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`befriending enumeration type` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is a C++11 extension`| +-----------------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`commas at the end of enumerator lists are a C++11 extension`| +--------------------------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`explicit conversion functions are a C++11 extension`| +------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`extern templates are a C++11 extension`| +-----------------------------------------------------------------------------+ +--------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`range-based for loop is a C++11 extension`| +--------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`generalized initializer lists are a C++11 extension`| +------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`use of enumeration in a nested name specifier is a C++11 extension`| +---------------------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`non-class friend type` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is a C++11 extension`| +----------------------------------------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`in-class initialization of non-static data member is a C++11 extension`| +-------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'`:placeholder:`A`:diagtext:`' keyword is a C++11 extension`| +--------------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`reference qualifiers on functions are a C++11 extension`| +----------------------------------------------------------------------------------------------+ +------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`rvalue references are a C++11 extension`| +------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`scoped enumerations are a C++11 extension`| +--------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`static data member` |nbsp| :placeholder:`A` |nbsp| :diagtext:`in union is a C++11 extension`| +----------------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------+----------------------+--------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`non-type template argument referring to` |nbsp| |+--------------------+| |nbsp| :placeholder:`B` |nbsp| :diagtext:`with internal linkage is a C++11 extension`| | ||:diagtext:`function`|| | | |+--------------------+| | | ||:diagtext:`object` || | | |+--------------------+| | +--------------------------------------------------------------------------------------+----------------------+--------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'template' keyword outside of a template`| +-------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`default template arguments for a function template are a C++11 extension`| +---------------------------------------------------------------------------------------------------------------+ -+-------------------------------------------------------------------+---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -|:warning:`warning:` |nbsp| :diagtext:`first declaration of` |nbsp| |+-------------------------------------+| |nbsp| :diagtext:`specialization of` |nbsp| :placeholder:`B` |nbsp| :diagtext:`outside namespace` |nbsp| :placeholder:`C` |nbsp| :diagtext:`is a C++11 extension`| -| ||:diagtext:`class template` || | -| |+-------------------------------------+| | -| ||:diagtext:`class template partial` || | -| |+-------------------------------------+| | -| ||:diagtext:`variable template` || | -| |+-------------------------------------+| | -| ||:diagtext:`variable template partial`|| | -| |+-------------------------------------+| | -| ||:diagtext:`function template` || | -| |+-------------------------------------+| | -| ||:diagtext:`member function` || | -| |+-------------------------------------+| | -| ||:diagtext:`static data member` || | -| |+-------------------------------------+| | -| ||:diagtext:`member class` || | -| |+-------------------------------------+| | -| ||:diagtext:`member enumeration` || | -| |+-------------------------------------+| | -+-------------------------------------------------------------------+---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - +------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'typename' occurs outside of a template`| +------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------------------------+-----------------------+-------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`unelaborated friend declaration is a C++11 extension; specify '`|+---------------------+|:diagtext:`' to befriend` |nbsp| :placeholder:`B`| | ||:diagtext:`struct` || | | |+---------------------+| | | ||:diagtext:`interface`|| | | |+---------------------+| | | ||:diagtext:`union` || | | |+---------------------+| | | ||:diagtext:`class` || | | |+---------------------+| | | ||:diagtext:`enum` || | | |+---------------------+| | +------------------------------------------------------------------------------------------------------+-----------------------+-------------------------------------------------+ +-------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`variadic templates are a C++11 extension`| +-------------------------------------------------------------------------------+ -Wc++11-extra-semi ------------------ **Diagnostic text:** +-------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`extra ';' outside of a function is a C++11 extension`| +-------------------------------------------------------------------------------------------+ -Wc++11-inline-namespace ------------------------ This diagnostic is enabled by default. **Diagnostic text:** +----------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`inline namespaces are a C++11 feature`| +----------------------------------------------------------------------------+ -Wc++11-long-long ----------------- **Diagnostic text:** +-----------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'long long' is a C++11 extension`| +-----------------------------------------------------------------------+ -Wc++11-narrowing ----------------- Some of the diagnostics controlled by this flag are enabled by default. **Diagnostic text:** +-----------------------+----------------------------------------+--------+--------------------------------------------------------------------------------------------------------------------------+ |:error:`error:` |nbsp| |+--------------------------------------+| |nbsp| |+------------------------------------------------------------------------------------------------------------------------+| | ||:diagtext:`case value` || ||+--------------------------------------------------------------------------------------------------------------+ || | |+--------------------------------------+| |||:diagtext:`cannot be narrowed from type` |nbsp| :placeholder:`C` |nbsp| :diagtext:`to` |nbsp| :placeholder:`D`| || | ||:diagtext:`enumerator value` || ||+--------------------------------------------------------------------------------------------------------------+ || | |+--------------------------------------+| |+------------------------------------------------------------------------------------------------------------------------+| | ||:diagtext:`non-type template argument`|| ||+----------------------------------------------------------------------------------------------------------------------+|| | |+--------------------------------------+| |||:diagtext:`evaluates to` |nbsp| :placeholder:`C`:diagtext:`, which cannot be narrowed to type` |nbsp| :placeholder:`D`||| | ||:diagtext:`array size` || ||+----------------------------------------------------------------------------------------------------------------------+|| | |+--------------------------------------+| |+------------------------------------------------------------------------------------------------------------------------+| | ||:diagtext:`constexpr if condition` || | | | |+--------------------------------------+| | | +-----------------------+----------------------------------------+--------+--------------------------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:error:`error:` |nbsp| :diagtext:`constant expression evaluates to` |nbsp| :placeholder:`A` |nbsp| :diagtext:`which cannot be narrowed to type` |nbsp| :placeholder:`B`| +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:error:`error:` |nbsp| :diagtext:`type` |nbsp| :placeholder:`A` |nbsp| :diagtext:`cannot be narrowed to` |nbsp| :placeholder:`B` |nbsp| :diagtext:`in initializer list`| +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:error:`error:` |nbsp| :diagtext:`non-constant-expression cannot be narrowed from type` |nbsp| :placeholder:`A` |nbsp| :diagtext:`to` |nbsp| :placeholder:`B` |nbsp| :diagtext:`in initializer list`| +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`constant expression evaluates to` |nbsp| :placeholder:`A` |nbsp| :diagtext:`which cannot be narrowed to type` |nbsp| :placeholder:`B` |nbsp| :diagtext:`in C++11`| +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`type` |nbsp| :placeholder:`A` |nbsp| :diagtext:`cannot be narrowed to` |nbsp| :placeholder:`B` |nbsp| :diagtext:`in initializer list in C++11`| +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`non-constant-expression cannot be narrowed from type` |nbsp| :placeholder:`A` |nbsp| :diagtext:`to` |nbsp| :placeholder:`B` |nbsp| :diagtext:`in initializer list in C++11`| +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wc++14-binary-literal ---------------------- **Diagnostic text:** +------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`binary integer literals are a C++14 extension`| +------------------------------------------------------------------------------------+ -Wc++14-compat -------------- Controls `-Wc++98-c++11-c++14-c++17-compat`_, `-Wc++98-c++11-c++14-compat`_. -Wc++14-compat-pedantic ----------------------- Controls `-Wc++14-compat`_, `-Wc++98-c++11-c++14-c++17-compat-pedantic`_, `-Wc++98-c++11-c++14-compat-pedantic`_. -Wc++14-extensions ------------------ Some of the diagnostics controlled by this flag are enabled by default. Also controls `-Wc++14-binary-literal`_. **Diagnostic text:** +-----------------------------------------------------------------------------------+-------------------------+----------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`use of this statement in a constexpr` |nbsp| |+-----------------------+| |nbsp| :diagtext:`is a C++14 extension`| | ||:diagtext:`function` || | | |+-----------------------+| | | ||:diagtext:`constructor`|| | | |+-----------------------+| | +-----------------------------------------------------------------------------------+-------------------------+----------------------------------------+ +------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`multiple return statements in constexpr function is a C++14 extension`| +------------------------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------+-------------------------+----------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`variable declaration in a constexpr` |nbsp| |+-----------------------+| |nbsp| :diagtext:`is a C++14 extension`| | ||:diagtext:`function` || | | |+-----------------------+| | | ||:diagtext:`constructor`|| | | |+-----------------------+| | +----------------------------------------------------------------------------------+-------------------------+----------------------------------------+ +-----------------------------------------------------------------------------+-------------------------+----------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`type definition in a constexpr` |nbsp| |+-----------------------+| |nbsp| :diagtext:`is a C++14 extension`| | ||:diagtext:`function` || | | |+-----------------------+| | | ||:diagtext:`constructor`|| | | |+-----------------------+| | +-----------------------------------------------------------------------------+-------------------------+----------------------------------------+ +---------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`use of the` |nbsp| :placeholder:`A` |nbsp| :diagtext:`attribute is a C++14 extension`| +---------------------------------------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'decltype(auto)' type specifier is a C++14 extension`| +-------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`initialized lambda captures are a C++14 extension`| +----------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`variable templates are a C++14 extension`| +-------------------------------------------------------------------------------+ -Wc++17-compat -------------- Some of the diagnostics controlled by this flag are enabled by default. Controls `-Wc++17-compat-mangling`_, `-Wc++98-c++11-c++14-c++17-compat`_, `-Wdeprecated-increment-bool`_, `-Wdeprecated-register`_. -Wc++17-compat-mangling ----------------------- This diagnostic is enabled by default. **Diagnostic text:** +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`mangled name of` |nbsp| :placeholder:`A` |nbsp| :diagtext:`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`_, `-Wc++98-c++11-c++14-c++17-compat-pedantic`_. -Wc++17-extensions ------------------ Some of the diagnostics controlled by this flag are enabled by default. **Diagnostic text:** ++--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`ISO C++ standards before C++17 do not allow new expression for type` |nbsp| :placeholder:`A` |nbsp| :diagtext:`to use list-initialization`| ++--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`constexpr if is a C++17 extension`| +------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'constexpr' on lambda expressions is a C++17 extension`| +---------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`use of the` |nbsp| :placeholder:`A` |nbsp| :diagtext:`attribute is a C++17 extension`| +---------------------------------------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`decomposition declarations are a C++17 extension`| +---------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`pack fold expression is a C++17 extension`| +--------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'begin' and 'end' returning different types (`:placeholder:`A` |nbsp| :diagtext:`and` |nbsp| :placeholder:`B`:diagtext:`) is a C++17 extension`| +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`hexadecimal floating literals are a C++17 feature`| +----------------------------------------------------------------------------------------+ +----------------------------------------+--------------------+-------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'`|+------------------+|:diagtext:`' initialization statements are a C++17 extension`| | ||:diagtext:`if` || | | |+------------------+| | | ||:diagtext:`switch`|| | | |+------------------+| | +----------------------------------------+--------------------+-------------------------------------------------------------+ +-----------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`inline variables are a C++17 extension`| +-----------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`use of multiple declarators in a single using declaration is a C++17 extension`| +---------------------------------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`nested namespace definition is a C++17 extension; define each namespace separately`| +-------------------------------------------------------------------------------------------------------------------------+ +------------------------------------------------------------+---------------------------+-----------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`attributes on` |nbsp| |+-------------------------+| |nbsp| :diagtext:`declaration are a C++17 extension`| | ||:diagtext:`a namespace` || | | |+-------------------------+| | | ||:diagtext:`an enumerator`|| | | |+-------------------------+| | +------------------------------------------------------------+---------------------------+-----------------------------------------------------+ +---------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`capture of '\*this' by copy is a C++17 extension`| +---------------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`static\_assert with no message is a C++17 extension`| +------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`template template parameter using 'typename' is a C++17 extension`| +--------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`default scope specifier for attributes is a C++17 extension`| +--------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`pack expansion of using declaration is a C++17 extension`| +-----------------------------------------------------------------------------------------------+ -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++2a-compat -------------- +Some of the diagnostics controlled by this flag are enabled by default. + **Diagnostic text:** ++------------------------------------------------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`'<=>' is a single token in C++2a; add a space to avoid a change in behavior`| ++------------------------------------------------------------------------------------------------------------------+ + +-------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'`:placeholder:`A`:diagtext:`' is a keyword in C++2a`| +-------------------------------------------------------------------------------------------+ -Wc++2a-compat-pedantic ----------------------- Synonym for `-Wc++2a-compat`_. -Wc++2a-extensions ------------------ Some of the diagnostics controlled by this flag are enabled by default. **Diagnostic text:** +----------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`default member initializer for bit-field is a C++2a extension`| +----------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`explicit capture of 'this' with a capture default of '=' is a C++2a extension`| +--------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`invoking a pointer to a 'const &' member function on an rvalue is a C++2a extension`| +--------------------------------------------------------------------------------------------------------------------------+ -Wc++98-c++11-c++14-c++17-compat -------------------------------- **Diagnostic text:** +-------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`default member initializer for bit-field is incompatible with C++ standards before C++2a`| +-------------------------------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`explicit capture of 'this' with a capture default of '=' is incompatible with C++ standards before C++2a`| +-----------------------------------------------------------------------------------------------------------------------------------------------+ ++-----------------------------------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`'<=>' operator is incompatible with C++ standards before C++2a`| ++-----------------------------------------------------------------------------------------------------+ ++----------------------------------------------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`'char8\_t' type specifier is incompatible with C++ standards before C++20`| ++----------------------------------------------------------------------------------------------------------------+ + + -Wc++98-c++11-c++14-c++17-compat-pedantic ----------------------------------------- Also controls `-Wc++98-c++11-c++14-c++17-compat`_. **Diagnostic text:** +-----------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`invoking a pointer to a 'const &' member function on an rvalue is incompatible with C++ standards before C++2a`| +-----------------------------------------------------------------------------------------------------------------------------------------------------+ -Wc++98-c++11-c++14-compat -------------------------- **Diagnostic text:** +---------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`constexpr if is incompatible with C++ standards before C++17`| +---------------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`constexpr on lambda expressions is incompatible with C++ standards before C++17`| +----------------------------------------------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`decomposition declarations are incompatible with C++ standards before C++17`| +------------------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`pack fold expression is incompatible with C++ standards before C++17`| +-----------------------------------------------------------------------------------------------------------+ +---------------------------+--------------------+----------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| |+------------------+| |nbsp| :diagtext:`initialization statements are incompatible with C++ standards before C++17`| | ||:diagtext:`if` || | | |+------------------+| | | ||:diagtext:`switch`|| | | |+------------------+| | +---------------------------+--------------------+----------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`inline variables are incompatible with C++ standards before C++17`| +--------------------------------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`nested namespace definition is incompatible with C++ standards before C++17`| +------------------------------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`by value capture of '\*this' is incompatible with C++ standards before C++17`| +-------------------------------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`static\_assert with no message is incompatible with C++ standards before C++17`| +---------------------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`non-type template parameters declared with` |nbsp| :placeholder:`A` |nbsp| :diagtext:`are incompatible with C++ standards before C++17`| +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`template template parameter using 'typename' is incompatible with C++ standards before C++17`| +-----------------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`unicode literals are incompatible with C++ standards before C++17`| +--------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`default scope specifier for attributes is incompatible with C++ standards before C++17`| +-----------------------------------------------------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`use of multiple declarators in a single using declaration is incompatible with C++ standards before C++17`| +------------------------------------------------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`pack expansion using declaration is incompatible with C++ standards before C++17`| +-----------------------------------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'begin' and 'end' returning different types (`:placeholder:`A` |nbsp| :diagtext:`and` |nbsp| :placeholder:`B`:diagtext:`) is incompatible with C++ standards before C++17`| +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wc++98-c++11-c++14-compat-pedantic ----------------------------------- Also controls `-Wc++98-c++11-c++14-compat`_. **Diagnostic text:** +------------------------------------------------------------+---------------------------+--------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`attributes on` |nbsp| |+-------------------------+| |nbsp| :diagtext:`declaration are incompatible with C++ standards before C++17`| | ||:diagtext:`a namespace` || | | |+-------------------------+| | | ||:diagtext:`an enumerator`|| | | |+-------------------------+| | +------------------------------------------------------------+---------------------------+--------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`hexadecimal floating literals are incompatible with C++ standards before C++17`| +---------------------------------------------------------------------------------------------------------------------+ -Wc++98-c++11-compat -------------------- **Diagnostic text:** +-----------------------------------------------------------------------------------+-------------------------+-------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`use of this statement in a constexpr` |nbsp| |+-----------------------+| |nbsp| :diagtext:`is incompatible with C++ standards before C++14`| | ||:diagtext:`function` || | | |+-----------------------+| | | ||:diagtext:`constructor`|| | | |+-----------------------+| | +-----------------------------------------------------------------------------------+-------------------------+-------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`multiple return statements in constexpr function is incompatible with C++ standards before C++14`| +---------------------------------------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`constexpr function with no return statements is incompatible with C++ standards before C++14`| +-----------------------------------------------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------+-------------------------+-------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`variable declaration in a constexpr` |nbsp| |+-----------------------+| |nbsp| :diagtext:`is incompatible with C++ standards before C++14`| | ||:diagtext:`function` || | | |+-----------------------+| | | ||:diagtext:`constructor`|| | | |+-----------------------+| | +----------------------------------------------------------------------------------+-------------------------+-------------------------------------------------------------------+ +-----------------------------------------------------------------------------+-------------------------+-------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`type definition in a constexpr` |nbsp| |+-----------------------+| |nbsp| :diagtext:`is incompatible with C++ standards before C++14`| | ||:diagtext:`function` || | | |+-----------------------+| | | ||:diagtext:`constructor`|| | | |+-----------------------+| | +-----------------------------------------------------------------------------+-------------------------+-------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'decltype(auto)' type specifier is incompatible with C++ standards before C++14`| +----------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`digit separators are incompatible with C++ standards before C++14`| +--------------------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`initialized lambda captures are incompatible with C++ standards before C++14`| +-------------------------------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`variable templates are incompatible with C++ standards before C++14`| +----------------------------------------------------------------------------------------------------------+ -Wc++98-c++11-compat-binary-literal ----------------------------------- **Diagnostic text:** +---------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`binary integer literals are incompatible with C++ standards before C++14`| +---------------------------------------------------------------------------------------------------------------+ -Wc++98-c++11-compat-pedantic ----------------------------- Controls `-Wc++98-c++11-compat`_, `-Wc++98-c++11-compat-binary-literal`_. -Wc++98-compat -------------- Also controls `-Wc++98-c++11-c++14-c++17-compat`_, `-Wc++98-c++11-c++14-compat`_, `-Wc++98-c++11-compat`_, `-Wc++98-compat-local-type-template-args`_, `-Wc++98-compat-unnamed-type-template-args`_. **Diagnostic text:** +-------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`alias declarations are incompatible with C++98`| +-------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'alignas' is incompatible with C++98`| +---------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`alignof expressions are incompatible with C++98`| +--------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`C++11 attribute syntax is incompatible with C++98`| +----------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'auto' type specifier is incompatible with C++98`| +---------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'constexpr' specifier is incompatible with C++98`| +---------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`constructor call from initializer list is incompatible with C++98`| +--------------------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'decltype' type specifier is incompatible with C++98`| +-------------------------------------------------------------------------------------------+ +---------------------------+-----------------------+--------------------------------------------------------------------+ |:warning:`warning:` |nbsp| |+---------------------+| |nbsp| :diagtext:`function definitions are incompatible with C++98`| | ||:diagtext:`defaulted`|| | | |+---------------------+| | | ||:diagtext:`deleted` || | | |+---------------------+| | +---------------------------+-----------------------+--------------------------------------------------------------------+ +------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`delegating constructors are incompatible with C++98`| +------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`scalar initialized from empty initializer list is incompatible with C++98`| +----------------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`enumeration types with a fixed underlying type are incompatible with C++98`| +-----------------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`befriending enumeration type` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is incompatible with C++98`| +-----------------------------------------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`enumeration type in nested name specifier is incompatible with C++98`| +-----------------------------------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`explicit conversion functions are incompatible with C++98`| +------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`range-based for loop is incompatible with C++98`| +--------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`friend declaration naming a member of the declaring class is incompatible with C++98`| +---------------------------------------------------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`generalized initializer lists are incompatible with C++98`| +------------------------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`jump from this goto statement to its label is incompatible with C++98`| +------------------------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`jump from this indirect goto statement to one of its possible targets is incompatible with C++98`| +---------------------------------------------------------------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`initialization of initializer\_list object is incompatible with C++98`| +------------------------------------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`inline namespaces are incompatible with C++98`| +------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`lambda expressions are incompatible with C++98`| +-------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'<::' is treated as digraph '<:' (aka '\[') followed by ':' in C++98`| +-----------------------------------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`literal operators are incompatible with C++98`| +------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`universal character name referring to a control character is incompatible with C++98`| +---------------------------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`specifying character '`:placeholder:`A`:diagtext:`' with a universal character name is incompatible with C++98`| +-----------------------------------------------------------------------------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`noexcept specifications are incompatible with C++98`| +------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`noexcept expressions are incompatible with C++98`| +---------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`use of non-static data member` |nbsp| :placeholder:`A` |nbsp| :diagtext:`in an unevaluated context is incompatible with C++98`| +--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`non-class friend type` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is incompatible with C++98`| +----------------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`in-class initialization of non-static data members is incompatible with C++98`| +--------------------------------------------------------------------------------------------------------------------+ +---------------------------+------------------------------+------------------------------------------------------------------------------------------------+--------------------------------------+----------------------------------------------+ |:warning:`warning:` |nbsp| |+----------------------------+| |nbsp| :diagtext:`member` |nbsp| :placeholder:`B` |nbsp| :diagtext:`with a non-trivial` |nbsp| |+------------------------------------+| |nbsp| :diagtext:`is incompatible with C++98`| -| ||:diagtext:`anonymous struct`|| ||:diagtext:`constructor` || | +| ||:diagtext:`anonymous struct`|| ||:diagtext:`default constructor` || | | |+----------------------------+| |+------------------------------------+| | | ||:diagtext:`union` || ||:diagtext:`copy constructor` || | | |+----------------------------+| |+------------------------------------+| | | | | ||:diagtext:`move constructor` || | | | | |+------------------------------------+| | | | | ||:diagtext:`copy assignment operator`|| | | | | |+------------------------------------+| | | | | ||:diagtext:`move assignment operator`|| | | | | |+------------------------------------+| | | | | ||:diagtext:`destructor` || | | | | |+------------------------------------+| | +---------------------------+------------------------------+------------------------------------------------------------------------------------------------+--------------------------------------+----------------------------------------------+ +---------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'nullptr' is incompatible with C++98`| +---------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'`:placeholder:`A`:diagtext:`' keyword is incompatible with C++98`| +--------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------+----------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`passing object of trivial but non-POD type` |nbsp| :placeholder:`A` |nbsp| :diagtext:`through variadic` |nbsp| |+-----------------------+| |nbsp| :diagtext:`is incompatible with C++98`| | ||:diagtext:`function` || | | |+-----------------------+| | | ||:diagtext:`block` || | | |+-----------------------+| | | ||:diagtext:`method` || | | |+-----------------------+| | | ||:diagtext:`constructor`|| | | |+-----------------------+| | +-----------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------+----------------------------------------------+ +--------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`raw string literals are incompatible with C++98`| +--------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`reference qualifiers on functions are incompatible with C++98`| +----------------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`reference initialized from initializer list is incompatible with C++98`| +-------------------------------------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`rvalue references are incompatible with C++98`| +------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`scoped enumerations are incompatible with C++98`| +--------------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`substitution failure due to access control is incompatible with C++98`| +------------------------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`static\_assert declarations are incompatible with C++98`| +----------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`static data member` |nbsp| :placeholder:`A` |nbsp| :diagtext:`in union is incompatible with C++98`| +----------------------------------------------------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`jump from switch statement to this case label is incompatible with C++98`| +---------------------------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`redundant parentheses surrounding address non-type template argument are incompatible with C++98`| +---------------------------------------------------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`use of null pointer as non-type template argument is incompatible with C++98`| +-------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------+----------------------+--------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`non-type template argument referring to` |nbsp| |+--------------------+| |nbsp| :placeholder:`B` |nbsp| :diagtext:`with internal linkage is incompatible with C++98`| | ||:diagtext:`function`|| | | |+--------------------+| | | ||:diagtext:`object` || | | |+--------------------+| | +--------------------------------------------------------------------------------------+----------------------+--------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`use of 'template' keyword outside of a template is incompatible with C++98`| +-----------------------------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`default template arguments for a function template are incompatible with C++98`| +---------------------------------------------------------------------------------------------------------------------+ -+---------------------------+---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -|:warning:`warning:` |nbsp| |+-------------------------------------+| |nbsp| :diagtext:`specialization of` |nbsp| :placeholder:`B` |nbsp| :diagtext:`outside namespace` |nbsp| :placeholder:`C` |nbsp| :diagtext:`is incompatible with C++98`| -| ||:diagtext:`class template` || | -| |+-------------------------------------+| | -| ||:diagtext:`class template partial` || | -| |+-------------------------------------+| | -| ||:diagtext:`variable template` || | -| |+-------------------------------------+| | -| ||:diagtext:`variable template partial`|| | -| |+-------------------------------------+| | -| ||:diagtext:`function template` || | -| |+-------------------------------------+| | -| ||:diagtext:`member function` || | -| |+-------------------------------------+| | -| ||:diagtext:`static data member` || | -| |+-------------------------------------+| | -| ||:diagtext:`member class` || | -| |+-------------------------------------+| | -| ||:diagtext:`member enumeration` || | -| |+-------------------------------------+| | -+---------------------------+---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - +----------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`trailing return types are incompatible with C++98`| +----------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`consecutive right angle brackets are incompatible with C++98 (use '> >')`| +---------------------------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`use of 'typename' outside of a template is incompatible with C++98`| +---------------------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------------+-----------------------+------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`befriending` |nbsp| :placeholder:`B` |nbsp| :diagtext:`without '`|+---------------------+|:diagtext:`' keyword is incompatible with C++98`| | ||:diagtext:`struct` || | | |+---------------------+| | | ||:diagtext:`interface`|| | | |+---------------------+| | | ||:diagtext:`union` || | | |+---------------------+| | | ||:diagtext:`class` || | | |+---------------------+| | | ||:diagtext:`enum` || | | |+---------------------+| | +-------------------------------------------------------------------------------------------------------+-----------------------+------------------------------------------------+ +-------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`using this character in an identifier is incompatible with C++98`| +-------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`unicode literals are incompatible with C++98`| +-----------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'`:placeholder:`A`:diagtext:`' type specifier is incompatible with C++98`| +---------------------------------------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`inheriting constructors are incompatible with C++98`| +------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`variadic templates are incompatible with C++98`| +-------------------------------------------------------------------------------------+ -Wc++98-compat-bind-to-temporary-copy ------------------------------------- **Diagnostic text:** -+---------------------------+-----------------------------------------+----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------+----------------------------+ -|:warning:`warning:` |nbsp| |+---------------------------------------+| |nbsp| :diagtext:`of type` |nbsp| :placeholder:`C` |nbsp| :diagtext:`when binding a reference to a temporary would` |nbsp| |+----------------------------------------------+| |nbsp| :diagtext:`in C++98`| -| ||:diagtext:`copying variable` || ||:diagtext:`invoke an inaccessible constructor`|| | -| |+---------------------------------------+| |+----------------------------------------------+| | -| ||:diagtext:`copying parameter` || ||:diagtext:`find no viable constructor` || | -| |+---------------------------------------+| |+----------------------------------------------+| | -| ||:diagtext:`returning object` || ||:diagtext:`find ambiguous constructors` || | -| |+---------------------------------------+| |+----------------------------------------------+| | -| ||:diagtext:`throwing object` || ||:diagtext:`invoke a deleted constructor` || | -| |+---------------------------------------+| |+----------------------------------------------+| | -| ||:diagtext:`copying member subobject` || | | | -| |+---------------------------------------+| | | | -| ||:diagtext:`copying array element` || | | | -| |+---------------------------------------+| | | | -| ||:diagtext:`allocating object` || | | | -| |+---------------------------------------+| | | | -| ||:diagtext:`copying temporary` || | | | -| |+---------------------------------------+| | | | -| ||:diagtext:`initializing base subobject`|| | | | -| |+---------------------------------------+| | | | -| ||:diagtext:`initializing vector element`|| | | | -| |+---------------------------------------+| | | | -+---------------------------+-----------------------------------------+----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------+----------------------------+ ++---------------------------+------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------+----------------------------+ +|:warning:`warning:` |nbsp| |+----------------------------------------------------+| |nbsp| :diagtext:`of type` |nbsp| :placeholder:`C` |nbsp| :diagtext:`when binding a reference to a temporary would` |nbsp| |+----------------------------------------------+| |nbsp| :diagtext:`in C++98`| +| ||:diagtext:`copying variable` || ||:diagtext:`invoke an inaccessible constructor`|| | +| |+----------------------------------------------------+| |+----------------------------------------------+| | +| ||:diagtext:`copying parameter` || ||:diagtext:`find no viable constructor` || | +| |+----------------------------------------------------+| |+----------------------------------------------+| | +| ||:diagtext:`returning object` || ||:diagtext:`find ambiguous constructors` || | +| |+----------------------------------------------------+| |+----------------------------------------------+| | +| ||:diagtext:`initializing statement expression result`|| ||:diagtext:`invoke a deleted constructor` || | +| |+----------------------------------------------------+| |+----------------------------------------------+| | +| ||:diagtext:`throwing object` || | | | +| |+----------------------------------------------------+| | | | +| ||:diagtext:`copying member subobject` || | | | +| |+----------------------------------------------------+| | | | +| ||:diagtext:`copying array element` || | | | +| |+----------------------------------------------------+| | | | +| ||:diagtext:`allocating object` || | | | +| |+----------------------------------------------------+| | | | +| ||:diagtext:`copying temporary` || | | | +| |+----------------------------------------------------+| | | | +| ||:diagtext:`initializing base subobject` || | | | +| |+----------------------------------------------------+| | | | +| ||:diagtext:`initializing vector element` || | | | +| |+----------------------------------------------------+| | | | +| ||:diagtext:`capturing value` || | | | +| |+----------------------------------------------------+| | | | ++---------------------------+------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------+----------------------------+ +-Wc++98-compat-extra-semi +------------------------- +**Diagnostic text:** + ++-------------------------------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`extra ';' outside of a function is incompatible with C++98`| ++-------------------------------------------------------------------------------------------------+ + + -Wc++98-compat-local-type-template-args --------------------------------------- **Diagnostic text:** +--------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`local type` |nbsp| :placeholder:`A` |nbsp| :diagtext:`as template argument is incompatible with C++98`| +--------------------------------------------------------------------------------------------------------------------------------------------+ -Wc++98-compat-pedantic ----------------------- -Also controls `-Wc++98-c++11-c++14-c++17-compat-pedantic`_, `-Wc++98-c++11-c++14-compat-pedantic`_, `-Wc++98-c++11-compat-pedantic`_, `-Wc++98-compat`_, `-Wc++98-compat-bind-to-temporary-copy`_. +Also controls `-Wc++98-c++11-c++14-c++17-compat-pedantic`_, `-Wc++98-c++11-c++14-compat-pedantic`_, `-Wc++98-c++11-compat-pedantic`_, `-Wc++98-compat`_, `-Wc++98-compat-bind-to-temporary-copy`_, `-Wc++98-compat-extra-semi`_. **Diagnostic text:** +---------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------+----------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`implicit conversion from array size expression of type` |nbsp| :placeholder:`A` |nbsp| :diagtext:`to` |nbsp| |+-----------------------+| |nbsp| :diagtext:`type` |nbsp| :placeholder:`C` |nbsp| :diagtext:`is incompatible with C++98`| | ||:diagtext:`integral` || | | |+-----------------------+| | | ||:diagtext:`enumeration`|| | | |+-----------------------+| | +---------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------+----------------------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`cast between pointer-to-function and pointer-to-object is incompatible with C++98`| +------------------------------------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`empty macro arguments are incompatible with C++98`| +----------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`commas at the end of enumerator lists are incompatible with C++98`| +--------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`extern templates are incompatible with C++98`| +-----------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'long long' is incompatible with C++98`| +-----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`C++98 requires newline at end of file`| +----------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`#line number greater than 32767 is incompatible with C++98`| +-------------------------------------------------------------------------------------------------+ -+-------------------------------------------------------------------------------------------------+ -|:warning:`warning:` |nbsp| :diagtext:`extra ';' outside of a function is incompatible with C++98`| -+-------------------------------------------------------------------------------------------------+ - +----------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`variadic macros are incompatible with C++98`| +----------------------------------------------------------------------------------+ -Wc++98-compat-unnamed-type-template-args ----------------------------------------- **Diagnostic text:** +---------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`unnamed type as template argument is incompatible with C++98`| +---------------------------------------------------------------------------------------------------+ -Wc11-extensions ---------------- **Diagnostic text:** +---------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`anonymous unions are a C11 extension`| +---------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is a C11-specific feature`| +----------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`anonymous structs are a C11 extension`| +----------------------------------------------------------------------------+ +------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`generic selections are a C11-specific feature`| +------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`\_Noreturn functions are a C11-specific feature`| +--------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`\_Static\_assert is a C11-specific feature`| +---------------------------------------------------------------------------------+ -Wc99-compat ------------ Some of the diagnostics controlled by this flag are enabled by default. **Diagnostic text:** +---------------------------+--------------------------------------------------------+--------------------------------------------+ |:warning:`warning:` |nbsp| |+------------------------------------------------------+| |nbsp| :diagtext:`is incompatible with C99`| | ||:diagtext:`using this character in an identifier` || | | |+------------------------------------------------------+| | | ||:diagtext:`starting an identifier with this character`|| | | |+------------------------------------------------------+| | +---------------------------+--------------------------------------------------------+--------------------------------------------+ +---------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`unicode literals are incompatible with C99`| +---------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------+----------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`integer literal is too large to be represented in type 'long', interpreting as 'unsigned long' per C89; this literal will` |nbsp| |+---------------------------------+| |nbsp| :diagtext:`in C99 onwards`| | ||:diagtext:`have type 'long long'`|| | | |+---------------------------------+| | | ||:diagtext:`be ill-formed` || | | |+---------------------------------+| | +------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------+----------------------------------+ -Wc99-extensions ---------------- Some of the diagnostics controlled by this flag are enabled by default. **Diagnostic text:** +-----------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`initializer for aggregate is not a compile-time constant`| +-----------------------------------------------------------------------------------------------+ +---------------------------+----------------------------------+------------------------------+-----------------------+----------------------------+ |:warning:`warning:` |nbsp| |+--------------------------------+|:diagtext:`array size` |nbsp| |+---------------------+|:diagtext:`is a C99 feature`| | ||:diagtext:`qualifier in` |nbsp| || || || | | |+--------------------------------+| |+---------------------+| | | ||:diagtext:`static` |nbsp| || || || | | |+--------------------------------+| |+---------------------+| | | || || ||:diagtext:`'\[\*\] '`|| | | |+--------------------------------+| |+---------------------+| | +---------------------------+----------------------------------+------------------------------+-----------------------+----------------------------+ +-----------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`compound literals are a C99-specific feature`| +-----------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`flexible array members are a C99 feature`| +-------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`variable declaration in for loop is a C99-specific feature`| +-------------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`ISO C99 requires whitespace after the macro name`| +---------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`designated initializers are a C99 feature`| +--------------------------------------------------------------------------------+ +------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`empty macro arguments are a C99 feature`| +------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`commas at the end of enumerator lists are a C99-specific feature`| +-------------------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`hexadecimal floating constants are a C99 feature`| +---------------------------------------------------------------------------------------+ -Wcast-align ------------ **Diagnostic text:** +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`cast from` |nbsp| :placeholder:`A` |nbsp| :diagtext:`to` |nbsp| :placeholder:`B` |nbsp| :diagtext:`increases required alignment from` |nbsp| :placeholder:`C` |nbsp| :diagtext:`to` |nbsp| :placeholder:`D`| +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wcast-calling-convention ------------------------- This diagnostic is enabled by default. **Diagnostic text:** +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`cast between incompatible calling conventions '`:placeholder:`A`:diagtext:`' and '`:placeholder:`B`:diagtext:`'; calls through this pointer may abort at runtime`| +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wcast-of-sel-type ------------------ This diagnostic is enabled by default. **Diagnostic text:** +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`cast of type` |nbsp| :placeholder:`A` |nbsp| :diagtext:`to` |nbsp| :placeholder:`B` |nbsp| :diagtext:`is deprecated; use sel\_getName instead`| +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wcast-qual ----------- **Diagnostic text:** +-------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`cast from` |nbsp| :placeholder:`A` |nbsp| :diagtext:`to` |nbsp| :placeholder:`B` |nbsp| :diagtext:`drops` |nbsp| |+-----------------------------------------+| | ||:diagtext:`const and volatile qualifiers`|| | |+-----------------------------------------+| | ||:diagtext:`const qualifier` || | |+-----------------------------------------+| | ||:diagtext:`volatile qualifier` || | |+-----------------------------------------+| +-------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+ +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`cast from` |nbsp| :placeholder:`A` |nbsp| :diagtext:`to` |nbsp| :placeholder:`B` |nbsp| :diagtext:`must have all intermediate pointers const qualified to be safe`| +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +-Wcast-qual-unrelated +--------------------- +This diagnostic is enabled by default. + +**Diagnostic text:** + ++---------------------------------------------------------------------+-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`ISO C++ does not allow` |nbsp| |+---------------------------------+| |nbsp| :diagtext:`from` |nbsp| :placeholder:`B` |nbsp| :diagtext:`to` |nbsp| :placeholder:`C` |nbsp| :diagtext:`because it casts away qualifiers, even though the source and destination types are unrelated`| +| ||:diagtext:`const\_cast` || | +| |+---------------------------------+| | +| ||:diagtext:`static\_cast` || | +| |+---------------------------------+| | +| ||:diagtext:`reinterpret\_cast` || | +| |+---------------------------------+| | +| ||:diagtext:`dynamic\_cast` || | +| |+---------------------------------+| | +| ||:diagtext:`C-style cast` || | +| |+---------------------------------+| | +| ||:diagtext:`functional-style cast`|| | +| |+---------------------------------+| | ++---------------------------------------------------------------------+-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + + -Wchar-align ------------ This diagnostic flag exists for GCC compatibility, and has no effect in Clang. -Wchar-subscripts ----------------- **Diagnostic text:** +------------------------------------------------------------+-------------------------+-------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`array section` |nbsp| |+-----------------------+| |nbsp| :diagtext:`is of type 'char'`| | ||:diagtext:`lower bound`|| | | |+-----------------------+| | | ||:diagtext:`length` || | | |+-----------------------+| | +------------------------------------------------------------+-------------------------+-------------------------------------+ +------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`array subscript is of type 'char'`| +------------------------------------------------------------------------+ -Wclang-cl-pch -------------- This diagnostic is enabled by default. **Diagnostic text:** +-------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`support for '/Yc' with more than one source file not implemented yet; flag ignored`| +-------------------------------------------------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`support for '/Yc' and '/Yu' with different filenames not implemented yet; flags ignored`| +------------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`support for '`:placeholder:`A`:diagtext:`' without a filename not implemented yet; flag ignored`| +--------------------------------------------------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`support for '`:placeholder:`A`:diagtext:`' without a corresponding /FI flag not implemented yet; flag ignored`| +----------------------------------------------------------------------------------------------------------------------------------------------------+ ++-----------------------------------------------------------------------------------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`definition of macro` |nbsp| :placeholder:`A` |nbsp| :diagtext:`does not match definition in precompiled header`| ++-----------------------------------------------------------------------------------------------------------------------------------------------------+ + -Wclass-varargs --------------- Some of the diagnostics controlled by this flag are enabled by default. Also controls `-Wnon-pod-varargs`_. **Diagnostic text:** +---------------------------------------------------------------------------------------------------------------------------------------+-------------------------+----------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`passing object of class type` |nbsp| :placeholder:`A` |nbsp| :diagtext:`through variadic` |nbsp| |+-----------------------+|+--------------------------------------------------------------------+| | ||:diagtext:`function` ||| || | |+-----------------------+|+--------------------------------------------------------------------+| | ||:diagtext:`block` |||+------------------------------------------------------------------+|| | |+-----------------------+|||:diagtext:`; did you mean to call '`:placeholder:`D`:diagtext:`'?`||| | ||:diagtext:`method` |||+------------------------------------------------------------------+|| | |+-----------------------+|+--------------------------------------------------------------------+| | ||:diagtext:`constructor`|| | | |+-----------------------+| | +---------------------------------------------------------------------------------------------------------------------------------------+-------------------------+----------------------------------------------------------------------+ -Wcomma ------- **Diagnostic text:** +-----------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`possible misuse of comma operator here`| +-----------------------------------------------------------------------------+ -Wcomment --------- Some of the diagnostics controlled by this flag are enabled by default. **Diagnostic text:** +--------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`escaped newline between \*/ characters at block comment end`| +--------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`// comments are not allowed in this language`| +-----------------------------------------------------------------------------------+ +------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`multi-line // comment`| +------------------------------------------------------------+ +-----------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'/\*' within block comment`| +-----------------------------------------------------------------+ -Wcomments ---------- Synonym for `-Wcomment`_. -Wcompare-distinct-pointer-types -------------------------------- This diagnostic is enabled by default. **Diagnostic text:** +---------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`comparison of distinct pointer types`| +---------------------------------------------------------------------------+ -Wcomplex-component-init ------------------------ **Diagnostic text:** +----------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`complex initialization specifying real and imaginary components is an extension`| +----------------------------------------------------------------------------------------------------------------------+ -Wconditional-type-mismatch --------------------------- This diagnostic is enabled by default. **Diagnostic text:** +----------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`pointer/integer type mismatch in conditional expression`| +----------------------------------------------------------------------------------------------+ -Wconditional-uninitialized --------------------------- **Diagnostic text:** +----------------------------------------------------------------------------------------------------------------------------+-------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`variable` |nbsp| :placeholder:`A` |nbsp| :diagtext:`may be uninitialized when` |nbsp| |+-----------------------------+| | ||:diagtext:`used here` || | |+-----------------------------+| | ||:diagtext:`captured by block`|| | |+-----------------------------+| +----------------------------------------------------------------------------------------------------------------------------+-------------------------------+ -Wconfig-macros --------------- This diagnostic is enabled by default. **Diagnostic text:** +---------------------------+------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------+---------------------------------------------------------+ |:warning:`warning:` |nbsp| |+----------------------+| |nbsp| :diagtext:`of configuration macro '`:placeholder:`B`:diagtext:`' has no effect on the import of '`:placeholder:`C`:diagtext:`'; pass '`|+------------------------------------------------+|:diagtext:`' on the command line to configure the module`| | ||:diagtext:`definition`|| ||+----------------------------------------------+|| | | |+----------------------+| |||:diagtext:`-D`:placeholder:`B`:diagtext:`=...`||| | | ||:diagtext:`#undef` || ||+----------------------------------------------+|| | | |+----------------------+| |+------------------------------------------------+| | | | | ||+------------------------------+ || | | | | |||:diagtext:`-U`:placeholder:`B`| || | | | | ||+------------------------------+ || | | | | |+------------------------------------------------+| | +---------------------------+------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------+---------------------------------------------------------+ -Wconstant-conversion --------------------- This diagnostic is enabled by default. Also controls `-Wbitfield-constant-conversion`_. **Diagnostic text:** +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`implicit conversion from` |nbsp| :placeholder:`C` |nbsp| :diagtext:`to` |nbsp| :placeholder:`D` |nbsp| :diagtext:`changes value from` |nbsp| :placeholder:`A` |nbsp| :diagtext:`to` |nbsp| :placeholder:`B`| +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wconstant-logical-operand -------------------------- This diagnostic is enabled by default. **Diagnostic text:** +----------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`use of logical '`:placeholder:`A`:diagtext:`' with constant operand`| +----------------------------------------------------------------------------------------------------------+ -Wconstexpr-not-const --------------------- This diagnostic is enabled by default. **Diagnostic text:** +----------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'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:`warning:` |nbsp| :diagtext:`consumed analysis attribute is attached to member of class '`:placeholder:`A`:diagtext:`' which isn't marked as consumable`| +-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`state of variable '`:placeholder:`A`:diagtext:`' must match at the entry and exit of loop`| +--------------------------------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`parameter '`:placeholder:`A`:diagtext:`' not in expected state when the function returns: expected '`:placeholder:`B`:diagtext:`', observed '`:placeholder:`C`:diagtext:`'`| +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`argument not in expected state; expected '`:placeholder:`A`:diagtext:`', observed '`:placeholder:`B`:diagtext:`'`| +-------------------------------------------------------------------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`return state set for an unconsumable type '`:placeholder:`A`:diagtext:`'`| +---------------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`return value not in expected state; expected '`:placeholder:`A`:diagtext:`', observed '`:placeholder:`B`:diagtext:`'`| +-----------------------------------------------------------------------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`invalid invocation of method '`:placeholder:`A`:diagtext:`' on object '`:placeholder:`B`:diagtext:`' while it is in the '`:placeholder:`C`:diagtext:`' state`| +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`invalid invocation of method '`:placeholder:`A`:diagtext:`' on a temporary object while it is in the '`:placeholder:`B`:diagtext:`' state`| +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wconversion ------------ Some of the diagnostics controlled by this flag are enabled by default. Also controls `-Wbitfield-enum-conversion`_, `-Wbool-conversion`_, `-Wconstant-conversion`_, `-Wenum-conversion`_, `-Wfloat-conversion`_, `-Wint-conversion`_, `-Wliteral-conversion`_, `-Wnon-literal-null-conversion`_, `-Wnull-conversion`_, `-Wobjc-literal-conversion`_, `-Wshorten-64-to-32`_, `-Wsign-conversion`_, `-Wstring-conversion`_. **Diagnostic text:** +--------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`implicit conversion discards imaginary component:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`to` |nbsp| :placeholder:`B`| +--------------------------------------------------------------------------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`implicit conversion loses floating-point precision:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`to` |nbsp| :placeholder:`B`| +----------------------------------------------------------------------------------------------------------------------------------------------------------------+ ++--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`implicit conversion when assigning computation result loses floating-point precision:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`to` |nbsp| :placeholder:`B`| ++--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +---------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`implicit conversion loses integer precision:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`to` |nbsp| :placeholder:`B`| +---------------------------------------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`implicit conversion turns vector to scalar:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`to` |nbsp| :placeholder:`B`| +--------------------------------------------------------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`non-type template argument with value '`:placeholder:`A`:diagtext:`' converted to '`:placeholder:`B`:diagtext:`' for unsigned template parameter of type` |nbsp| :placeholder:`C`| +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`non-type template argument value '`:placeholder:`A`:diagtext:`' truncated to '`:placeholder:`B`:diagtext:`' for template parameter of type` |nbsp| :placeholder:`C`| +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wconversion-null ----------------- Synonym for `-Wnull-conversion`_. -Wcoroutine ----------- Synonym for `-Wcoroutine-missing-unhandled-exception`_. -Wcoroutine-missing-unhandled-exception --------------------------------------- This diagnostic is enabled by default. **Diagnostic text:** +-----------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is required to declare the member 'unhandled\_exception()' when exceptions are enabled`| +-----------------------------------------------------------------------------------------------------------------------------------------------------+ -Wcovered-switch-default ------------------------ **Diagnostic text:** +--------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`default label in switch which covers all enumeration values`| +--------------------------------------------------------------------------------------------------+ -Wcpp ----- Synonym for `-W#warnings`_. -Wcstring-format-directive -------------------------- **Diagnostic text:** +------------------------------------------------------------------------------------------------------------+----------------------+--------------------------------------------------------------------------------------------+------------------------+ |:warning:`warning:` |nbsp| :diagtext:`using` |nbsp| :placeholder:`A` |nbsp| :diagtext:`directive in` |nbsp| |+--------------------+| |nbsp| :diagtext:`which is being passed as a formatting argument to the formatting` |nbsp| |+----------------------+| | ||:diagtext:`NSString`|| ||:diagtext:`method` || | |+--------------------+| |+----------------------+| | ||:diagtext:`CFString`|| ||:diagtext:`CFfunction`|| | |+--------------------+| |+----------------------+| +------------------------------------------------------------------------------------------------------------+----------------------+--------------------------------------------------------------------------------------------+------------------------+ -Wctor-dtor-privacy ------------------- This diagnostic flag exists for GCC compatibility, and has no effect in Clang. -Wcuda-compat ------------- Some of the diagnostics controlled by this flag are enabled by default. **Diagnostic text:** +-------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`attribute parameter` |nbsp| :placeholder:`B` |nbsp| :diagtext:`is negative and will be ignored`| +-------------------------------------------------------------------------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`nvcc does not allow '\_\_`:placeholder:`A`:diagtext:`\_\_' to appear after '()' in lambdas`| +---------------------------------------------------------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`ignored 'inline' attribute on kernel function` |nbsp| :placeholder:`A`| +------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`kernel function` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is a member function; this may not be accepted by nvcc`| +--------------------------------------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`argument to '#pragma unroll' should not be in parentheses in CUDA C/C++`| +--------------------------------------------------------------------------------------------------------------+ -Wcustom-atomic-properties -------------------------- **Diagnostic text:** +---------------------------------------------------------------------------------------------------------------------------------------+--------------------+----------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`atomic by default property` |nbsp| :placeholder:`A` |nbsp| :diagtext:`has a user defined` |nbsp| |+------------------+| |nbsp| :diagtext:`(property should be marked 'atomic' if this is intended)`| | ||:diagtext:`getter`|| | | |+------------------+| | | ||:diagtext:`setter`|| | | |+------------------+| | +---------------------------------------------------------------------------------------------------------------------------------------+--------------------+----------------------------------------------------------------------------+ +-Wdangling +---------- +This diagnostic is enabled by default. + +Also controls `-Wdangling-field`_, `-Wdangling-initializer-list`_, `-Wreturn-stack-address`_. + +**Diagnostic text:** + ++---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------+----------------------------+---------------------------------------------------------------+ +|:warning:`warning:` |nbsp| |+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+| |nbsp| |+--------------------------+|:diagtext:`will be destroyed at the end of the full-expression`| +| ||+-----------------------------+---------------------------------------------------------+--------+------------------------------------------------------------------------+|| ||+------------------------+|| | +| |||:diagtext:`temporary` |nbsp| |+-------------------------------------------------------+| |nbsp| |+----------------------------------------------------------------------+||| |||:placeholder:`D` |nbsp| ||| | +| ||| ||:diagtext:`whose address is used as value of` || ||+-------------------------------+------------------------------------+|||| ||+------------------------+|| | +| ||| |+-------------------------------------------------------+| |||+-----------------------------+|:diagtext:`member of local variable`||||| |+--------------------------+| | +| ||| ||+--------------------------------+--------------------+|| |||| || ||||| || || | +| ||| |||+------------------------------+|:diagtext:`bound to`||| |||+-----------------------------+| ||||| |+--------------------------+| | +| ||| |||| || ||| ||||:diagtext:`reference` |nbsp| || ||||| | | | +| ||| |||+------------------------------+| ||| |||+-----------------------------+| ||||| | | | +| ||| ||||:diagtext:`implicitly` |nbsp| || ||| ||+-------------------------------+------------------------------------+|||| | | | +| ||| |||+------------------------------+| ||| |+----------------------------------------------------------------------+||| | | | +| ||| ||+--------------------------------+--------------------+|| ||+-------------------------+-----------------------+ |||| | | | +| ||| |+-------------------------------------------------------+| |||:diagtext:`local` |nbsp| |+---------------------+| |||| | | | +| ||| | | ||| ||:diagtext:`variable` || |||| | | | +| ||| | | ||| |+---------------------+| |||| | | | +| ||| | | ||| ||:diagtext:`reference`|| |||| | | | +| ||| | | ||| |+---------------------+| |||| | | | +| ||| | | ||+-------------------------+-----------------------+ |||| | | | +| ||| | | |+----------------------------------------------------------------------+||| | | | +| ||+-----------------------------+---------------------------------------------------------+--------+------------------------------------------------------------------------+|| | | | +| |+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+| | | | +| ||+---------------------------------+----------------------------------------------------------+ || | | | +| |||:diagtext:`array backing` |nbsp| |+--------------------------------------------------------+| || | | | +| ||| ||:diagtext:`initializer list subobject of local variable`|| || | | | +| ||| |+--------------------------------------------------------+| || | | | +| ||| ||:diagtext:`local initializer list` || || | | | +| ||| |+--------------------------------------------------------+| || | | | +| ||+---------------------------------+----------------------------------------------------------+ || | | | +| |+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+| | | | ++---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------+----------------------------+---------------------------------------------------------------+ + ++---------------------------------------------------------------------------+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+---------------------------+--------------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`sorry, lifetime extension of` |nbsp| |+---------------------------------------------+| |nbsp| :diagtext:`created by aggregate initialization using default member initializer is not supported; lifetime of` |nbsp| |+-------------------------+| |nbsp| :diagtext:`will end at the end of the full-expression`| +| ||:diagtext:`temporary` || ||:diagtext:`temporary` || | +| |+---------------------------------------------+| |+-------------------------+| | +| ||:diagtext:`backing array of initializer list`|| ||:diagtext:`backing array`|| | +| |+---------------------------------------------+| |+-------------------------+| | ++---------------------------------------------------------------------------+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+---------------------------+--------------------------------------------------------------+ + + -Wdangling-else --------------- This diagnostic is enabled by default. **Diagnostic text:** +---------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`add explicit braces to avoid dangling else`| +---------------------------------------------------------------------------------+ -Wdangling-field ---------------- This diagnostic is enabled by default. **Diagnostic text:** -+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ -|:warning:`warning:` |nbsp| :diagtext:`binding reference member` |nbsp| :placeholder:`A` |nbsp| :diagtext:`to stack allocated parameter` |nbsp| :placeholder:`B`| -+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ ++-------------------------------------------------------------------------------------------------------------------------------------+-----------------------+------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`binding reference member` |nbsp| :placeholder:`A` |nbsp| :diagtext:`to stack allocated` |nbsp| |+---------------------+| |nbsp| :placeholder:`B`| +| ||:diagtext:`variable` || | +| |+---------------------+| | +| ||:diagtext:`parameter`|| | +| |+---------------------+| | ++-------------------------------------------------------------------------------------------------------------------------------------+-----------------------+------------------------+ -+----------------------------------------------------------------+----------------------------------+----------------------------------------------------------------------------------+ -|:warning:`warning:` |nbsp| :diagtext:`binding reference` |nbsp| |+--------------------------------+|:diagtext:`member` |nbsp| :placeholder:`A` |nbsp| :diagtext:`to a temporary value`| -| || || | -| |+--------------------------------+| | -| ||:diagtext:`subobject of` |nbsp| || | -| |+--------------------------------+| | -+----------------------------------------------------------------+----------------------------------+----------------------------------------------------------------------------------+ ++---------------------------+--------------------------------------------------------+--------+----------------------------------+--------------------------------------------------+----------------------+------------------------------------------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| |+------------------------------------------------------+| |nbsp| |+--------------------------------+|:diagtext:`member` |nbsp| :placeholder:`A` |nbsp| |+--------------------+| |nbsp| :diagtext:`a temporary object whose lifetime is shorter than the lifetime of the constructed object`| +| ||:diagtext:`reference` || || || ||:diagtext:`binds to`|| | +| |+------------------------------------------------------+| |+--------------------------------+| |+--------------------+| | +| ||:diagtext:`backing array for 'std::initializer\_list'`|| ||:diagtext:`subobject of` |nbsp| || ||:diagtext:`is` || | +| |+------------------------------------------------------+| |+--------------------------------+| |+--------------------+| | ++---------------------------+--------------------------------------------------------+--------+----------------------------------+--------------------------------------------------+----------------------+------------------------------------------------------------------------------------------------------------+ -+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -|:warning:`warning:` |nbsp| :diagtext:`initializing pointer member` |nbsp| :placeholder:`A` |nbsp| :diagtext:`with the stack address of parameter` |nbsp| :placeholder:`B`| -+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ ++-----------------------------------------------------------------------------------------------------------------------------------------------+-----------------------+------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`initializing pointer member` |nbsp| :placeholder:`A` |nbsp| :diagtext:`with the stack address of` |nbsp| |+---------------------+| |nbsp| :placeholder:`B`| +| ||:diagtext:`variable` || | +| |+---------------------+| | +| ||:diagtext:`parameter`|| | +| |+---------------------+| | ++-----------------------------------------------------------------------------------------------------------------------------------------------+-----------------------+------------------------+ ++--------------------------------------------------------------------------------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`temporary bound to reference member of allocated object will be destroyed at the end of the full-expression`| ++--------------------------------------------------------------------------------------------------------------------------------------------------+ + -Wdangling-initializer-list --------------------------- This diagnostic is enabled by default. **Diagnostic text:** -+-----------------------------------------------------------------------------------------------------------------+---------------------------------+ -|:warning:`warning:` |nbsp| :diagtext:`array backing the initializer list will be destroyed at the end of` |nbsp| |+-------------------------------+| -| ||:diagtext:`the full-expression`|| -| |+-------------------------------+| -| ||:diagtext:`the constructor` || -| |+-------------------------------+| -+-----------------------------------------------------------------------------------------------------------------+---------------------------------+ ++------------------------------------------------------------+----------------------------------------------------------------+-----------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`array backing` |nbsp| |+--------------------------------------------------------------+| |nbsp| :diagtext:`will be destroyed at the end of the full-expression`| +| ||:diagtext:`initializer list subobject of the allocated object`|| | +| |+--------------------------------------------------------------+| | +| ||:diagtext:`the allocated initializer list` || | +| |+--------------------------------------------------------------+| | ++------------------------------------------------------------+----------------------------------------------------------------+-----------------------------------------------------------------------+ -Wdate-time ----------- **Diagnostic text:** +------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`expansion of date or time macro is not reproducible`| +------------------------------------------------------------------------------------------+ -Wdealloc-in-category --------------------- This diagnostic is enabled by default. **Diagnostic text:** +---------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`-dealloc is being overridden in a category`| +---------------------------------------------------------------------------------+ -Wdebug-compression-unavailable ------------------------------- This diagnostic is enabled by default. **Diagnostic text:** +------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`cannot compress debug sections (zlib not installed)`| +------------------------------------------------------------------------------------------+ -Wdeclaration-after-statement ----------------------------- **Diagnostic text:** +-----------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`ISO C90 forbids mixing declarations and code`| +-----------------------------------------------------------------------------------+ -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:`error:` |nbsp| :diagtext:`constructor for` |nbsp| :placeholder:`A` |nbsp| :diagtext:`creates a delegation cycle`| +------------------------------------------------------------------------------------------------------------------------+ -Wdelete-incomplete ------------------- This diagnostic is enabled by default. **Diagnostic text:** +-------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`cannot delete expression with pointer-to-'void' type` |nbsp| :placeholder:`A`| +-------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`deleting pointer to incomplete type` |nbsp| :placeholder:`A` |nbsp| :diagtext:`may cause undefined behavior`| +--------------------------------------------------------------------------------------------------------------------------------------------------+ -Wdelete-non-virtual-dtor ------------------------- Some of the diagnostics controlled by this flag are enabled by default. **Diagnostic text:** +---------------------------+------------------------+------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| |+----------------------+| |nbsp| :diagtext:`called on` |nbsp| :placeholder:`B` |nbsp| :diagtext:`that is abstract but has non-virtual destructor`| | ||:diagtext:`delete` || | | |+----------------------+| | | ||:diagtext:`destructor`|| | | |+----------------------+| | +---------------------------+------------------------+------------------------------------------------------------------------------------------------------------------------+ +---------------------------+------------------------+----------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| |+----------------------+| |nbsp| :diagtext:`called on non-final` |nbsp| :placeholder:`B` |nbsp| :diagtext:`that has virtual functions but non-virtual destructor`| | ||:diagtext:`delete` || | | |+----------------------+| | | ||:diagtext:`destructor`|| | | |+----------------------+| | +---------------------------+------------------------+----------------------------------------------------------------------------------------------------------------------------------------+ -Wdeprecated ------------ Some of the diagnostics controlled by this flag are enabled by default. -Also controls `-Wdeprecated-attributes`_, `-Wdeprecated-declarations`_, `-Wdeprecated-dynamic-exception-spec`_, `-Wdeprecated-increment-bool`_, `-Wdeprecated-register`_, `-Wdeprecated-writable-strings`_. +Also controls `-Wdeprecated-attributes`_, `-Wdeprecated-declarations`_, `-Wdeprecated-dynamic-exception-spec`_, `-Wdeprecated-increment-bool`_, `-Wdeprecated-register`_, `-Wdeprecated-this-capture`_, `-Wdeprecated-writable-strings`_. **Diagnostic text:** +---------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`-O4 is equivalent to -O3`| +---------------------------------------------------------------+ +---------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`access declarations are deprecated; use using declarations instead`| +---------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------+---------------------------------+-----------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`definition of implicit copy` |nbsp| |+-------------------------------+| |nbsp| :diagtext:`for` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is deprecated because it has a user-declared` |nbsp| |+------------------------------------------------------------+| | ||:diagtext:`constructor` || ||+------------------------+---------------------------------+|| | |+-------------------------------+| |||:diagtext:`copy` |nbsp| |+-------------------------------+||| | ||:diagtext:`assignment operator`|| ||| ||:diagtext:`assignment operator`|||| | |+-------------------------------+| ||| |+-------------------------------+||| | | | ||| ||:diagtext:`constructor` |||| | | | ||| |+-------------------------------+||| | | | ||+------------------------+---------------------------------+|| | | | |+------------------------------------------------------------+| | | | ||:diagtext:`destructor` || | | | |+------------------------------------------------------------+| +--------------------------------------------------------------------------+---------------------------------+-----------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`out-of-line definition of constexpr static data member is redundant in C++17 and is deprecated`| +-------------------------------------------------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`argument '`:placeholder:`A`:diagtext:`' is deprecated, use '`:placeholder:`B`:diagtext:`' instead`| +----------------------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`treating '`:placeholder:`A`:diagtext:`' input as '`:placeholder:`B`:diagtext:`' when in C++ mode, this behavior is deprecated`| +--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`OpenCL version` |nbsp| :placeholder:`A` |nbsp| :diagtext:`does not support the option '`:placeholder:`B`:diagtext:`'`| +-----------------------------------------------------------------------------------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`Use of 'long' with '\_\_vector' is deprecated`| +------------------------------------------------------------------------------------+ -Wdeprecated-attributes ----------------------- This diagnostic is enabled by default. **Diagnostic text:** +------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`specifying vector types with the 'mode' attribute is deprecated; use the 'vector\_size' attribute instead`| +------------------------------------------------------------------------------------------------------------------------------------------------+ -Wdeprecated-declarations ------------------------- This diagnostic is enabled by default. **Diagnostic text:** +--------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`specifying 'uuid' as an ATL attribute is deprecated; use \_\_declspec instead`| +--------------------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`use of C-style parameters in Objective-C method declarations is deprecated`| +-----------------------------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is deprecated`| +----------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`may be deprecated because the receiver type is unknown`| +---------------------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is deprecated:` |nbsp| :placeholder:`B`| +-----------------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`property access is using` |nbsp| :placeholder:`A` |nbsp| :diagtext:`method which is deprecated`| +-------------------------------------------------------------------------------------------------------------------------------------+ -Wdeprecated-dynamic-exception-spec ----------------------------------- **Diagnostic text:** +--------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`dynamic exception specifications are deprecated`| +--------------------------------------------------------------------------------------+ -Wdeprecated-implementations ---------------------------- **Diagnostic text:** +----------------------------------------------------------------------+----------------------+ |:warning:`warning:` |nbsp| :diagtext:`implementing deprecated` |nbsp| |+--------------------+| | ||:diagtext:`method` || | |+--------------------+| | ||:diagtext:`class` || | |+--------------------+| | ||:diagtext:`category`|| | |+--------------------+| +----------------------------------------------------------------------+----------------------+ +----------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`implementing unavailable method`| +----------------------------------------------------------------------+ -Wdeprecated-increment-bool --------------------------- This diagnostic is enabled by default. **Diagnostic text:** +---------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`incrementing expression of type bool is deprecated and incompatible with C++17`| +---------------------------------------------------------------------------------------------------------------------+ -Wdeprecated-objc-isa-usage --------------------------- This diagnostic is enabled by default. **Diagnostic text:** +-------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`assignment to Objective-C's isa is deprecated in favor of object\_setClass()`| +-------------------------------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`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:`warning:` |nbsp| :diagtext:`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:`warning:` |nbsp| :diagtext:`bitmasking for introspection of Objective-C object pointers is strongly discouraged`| +--------------------------------------------------------------------------------------------------------------------------+ -Wdeprecated-register --------------------- This diagnostic is enabled by default. **Diagnostic text:** +-------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'register' storage class specifier is deprecated and incompatible with C++17`| +-------------------------------------------------------------------------------------------------------------------+ +-Wdeprecated-this-capture +------------------------- +**Diagnostic text:** + ++-------------------------------------------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`implicit capture of 'this' with a capture default of '=' is deprecated`| ++-------------------------------------------------------------------------------------------------------------+ + + -Wdeprecated-writable-strings ----------------------------- Synonym for `-Wc++11-compat-deprecated-writable-strings`_. -Wdirect-ivar-access -------------------- **Diagnostic text:** +------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`instance variable` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is being directly accessed`| +------------------------------------------------------------------------------------------------------------------------------+ -Wdisabled-macro-expansion -------------------------- **Diagnostic text:** +----------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`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:`warning:` |nbsp| :diagtext:`conflicting distributed object modifiers on parameter type in implementation of` |nbsp| :placeholder:`A`| +----------------------------------------------------------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`conflicting distributed object modifiers on return type in implementation of` |nbsp| :placeholder:`A`| +-------------------------------------------------------------------------------------------------------------------------------------------+ -Wdiv-by-zero ------------- Synonym for `-Wdivision-by-zero`_. -Wdivision-by-zero ------------------ This diagnostic is enabled by default. **Diagnostic text:** +---------------------------+-----------------------+----------------------------------------+ |:warning:`warning:` |nbsp| |+---------------------+| |nbsp| :diagtext:`by zero is undefined`| | ||:diagtext:`remainder`|| | | |+---------------------+| | | ||:diagtext:`division` || | | |+---------------------+| | +---------------------------+-----------------------+----------------------------------------+ -Wdll-attribute-on-redeclaration -------------------------------- This diagnostic is enabled by default. **Diagnostic text:** +----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`redeclaration of` |nbsp| :placeholder:`A` |nbsp| :diagtext:`should not add` |nbsp| :placeholder:`B` |nbsp| :diagtext:`attribute`| +----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wdllexport-explicit-instantiation-decl --------------------------------------- This diagnostic is enabled by default. **Diagnostic text:** +---------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`explicit instantiation declaration should not be 'dllexport'`| +---------------------------------------------------------------------------------------------------+ -Wdllimport-static-field-def ---------------------------- This diagnostic is enabled by default. **Diagnostic text:** +---------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`definition of dllimport static field`| +---------------------------------------------------------------------------+ -Wdocumentation --------------- Also controls `-Wdocumentation-deprecated-sync`_, `-Wdocumentation-html`_. **Diagnostic text:** +----------------------------------------+----------------+-----------------------+------------------------------------------------------------------------+-----------------------+-------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'`|+--------------+|+---------------------+|:diagtext:`' command should not be used in a comment attached to a non-`|+---------------------+| |nbsp| :diagtext:`declaration`| | ||:diagtext:`\\`|||:diagtext:`class` || ||:diagtext:`class` || | | |+--------------+|+---------------------+| |+---------------------+| | | ||:diagtext:`@` |||:diagtext:`interface`|| ||:diagtext:`interface`|| | | |+--------------+|+---------------------+| |+---------------------+| | | | ||:diagtext:`protocol` || ||:diagtext:`protocol` || | | | |+---------------------+| |+---------------------+| | | | ||:diagtext:`struct` || ||:diagtext:`struct` || | | | |+---------------------+| |+---------------------+| | | | ||:diagtext:`union` || ||:diagtext:`union` || | | | |+---------------------+| |+---------------------+| | +----------------------------------------+----------------+-----------------------+------------------------------------------------------------------------+-----------------------+-------------------------------+ +-----------------------------------------------------------+----------------+-----------------------------+ |:warning:`warning:` |nbsp| :diagtext:`duplicated command '`|+--------------+|:placeholder:`B`:diagtext:`'`| | ||:diagtext:`\\`|| | | |+--------------+| | | ||:diagtext:`@` || | | |+--------------+| | +-----------------------------------------------------------+----------------+-----------------------------+ +------------------------------------------------------------------+----------------+-------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`empty paragraph passed to '`|+--------------+|:placeholder:`B`:diagtext:`' command`| | ||:diagtext:`\\`|| | | |+--------------+| | | ||:diagtext:`@` || | | |+--------------+| | +------------------------------------------------------------------+----------------+-------------------------------------+ +----------------------------------------+----------------+--------------------------+---------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'`|+--------------+|+------------------------+|:diagtext:`' command should not be used in a comment attached to a non-container declaration`| | ||:diagtext:`\\`|||:diagtext:`classdesign` || | | |+--------------+|+------------------------+| | | ||:diagtext:`@` |||:diagtext:`coclass` || | | |+--------------+|+------------------------+| | | | ||:diagtext:`dependency` || | | | |+------------------------+| | | | ||:diagtext:`helper` || | | | |+------------------------+| | | | ||:diagtext:`helperclass` || | | | |+------------------------+| | | | ||:diagtext:`helps` || | | | |+------------------------+| | | | ||:diagtext:`instancesize`|| | | | |+------------------------+| | | | ||:diagtext:`ownership` || | | | |+------------------------+| | | | ||:diagtext:`performance` || | | | |+------------------------+| | | | ||:diagtext:`security` || | | | |+------------------------+| | | | ||:diagtext:`superclass` || | | | |+------------------------+| | +----------------------------------------+----------------+--------------------------+---------------------------------------------------------------------------------------------+ +----------------------------------------+----------------+---------------------------+---------------------------------------------------------------------+-----------------------------------+-------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'`|+--------------+|+-------------------------+|:diagtext:`' command should be used in a comment attached to` |nbsp| |+---------------------------------+| |nbsp| :diagtext:`declaration`| | ||:diagtext:`\\`|||:diagtext:`function` || ||:diagtext:`a function` || | | |+--------------+|+-------------------------+| |+---------------------------------+| | | ||:diagtext:`@` |||:diagtext:`functiongroup`|| ||:diagtext:`a function` || | | |+--------------+|+-------------------------+| |+---------------------------------+| | | | ||:diagtext:`method` || ||:diagtext:`an Objective-C method`|| | | | |+-------------------------+| |+---------------------------------+| | | | ||:diagtext:`methodgroup` || ||:diagtext:`an Objective-C method`|| | | | |+-------------------------+| |+---------------------------------+| | | | ||:diagtext:`callback` || ||:diagtext:`a pointer to function`|| | | | |+-------------------------+| |+---------------------------------+| | +----------------------------------------+----------------+---------------------------+---------------------------------------------------------------------+-----------------------------------+-------------------------------+ +-------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`HTML start tag prematurely ended, expected attribute name or '>'`| +-------------------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`expected quoted string after equals sign`| +-------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`parameter '`:placeholder:`A`:diagtext:`' is already documented`| +-----------------------------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`unrecognized parameter passing direction, valid directions are '\[in\]', '\[out\]' and '\[in,out\]'`| +------------------------------------------------------------------------------------------------------------------------------------------+ +----------------------------------------+----------------+-------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'`|+--------------+|:diagtext:`param' command used in a comment that is not attached to a function declaration`| | ||:diagtext:`\\`|| | | |+--------------+| | | ||:diagtext:`@` || | | |+--------------+| | +----------------------------------------+----------------+-------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`parameter '`:placeholder:`A`:diagtext:`' not found in the function declaration`| +---------------------------------------------------------------------------------------------------------------------+ +----------------------------------------+----------------+-------------------------------------------------------------------------------------+-------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'`|+--------------+|:placeholder:`B`:diagtext:`' command used in a comment that is attached to a` |nbsp| |+-----------------------------------+| | ||:diagtext:`\\`|| ||:diagtext:`function returning void`|| | |+--------------+| |+-----------------------------------+| | ||:diagtext:`@` || ||:diagtext:`constructor` || | |+--------------+| |+-----------------------------------+| | | | ||:diagtext:`destructor` || | | | |+-----------------------------------+| | | | ||:diagtext:`method returning void` || | | | |+-----------------------------------+| +----------------------------------------+----------------+-------------------------------------------------------------------------------------+-------------------------------------+ +----------------------------------------+----------------+----------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'`|+--------------+|:placeholder:`B`:diagtext:`' command used in a comment that is not attached to a function or method declaration`| | ||:diagtext:`\\`|| | | |+--------------+| | | ||:diagtext:`@` || | | |+--------------+| | +----------------------------------------+----------------+----------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`template parameter '`:placeholder:`A`:diagtext:`' is already documented`| +--------------------------------------------------------------------------------------------------------------+ +----------------------------------------+----------------+--------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'`|+--------------+|:diagtext:`tparam' command used in a comment that is not attached to a template declaration`| | ||:diagtext:`\\`|| | | |+--------------+| | | ||:diagtext:`@` || | | |+--------------+| | +----------------------------------------+----------------+--------------------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`template parameter '`:placeholder:`A`:diagtext:`' not found in the template declaration`| +------------------------------------------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`not a Doxygen trailing comment`| +---------------------------------------------------------------------+ +----------------------------------------+----------------+------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'`|+--------------+|:placeholder:`B`:diagtext:`' command does not terminate a verbatim text block`| | ||:diagtext:`\\`|| | | |+--------------+| | | ||:diagtext:`@` || | | |+--------------+| | +----------------------------------------+----------------+------------------------------------------------------------------------------+ -Wdocumentation-deprecated-sync ------------------------------- **Diagnostic text:** +----------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`declaration is marked with '\\deprecated' command but does not have a deprecation attribute`| +----------------------------------------------------------------------------------------------------------------------------------+ -Wdocumentation-html -------------------- **Diagnostic text:** +-----------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`HTML end tag '`:placeholder:`A`:diagtext:`' is forbidden`| +-----------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`HTML end tag does not match any start tag`| +--------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`HTML tag '`:placeholder:`A`:diagtext:`' requires an end tag`| +--------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`HTML start tag '`:placeholder:`A`:diagtext:`' closed by '`:placeholder:`B`:diagtext:`'`| +-----------------------------------------------------------------------------------------------------------------------------+ -Wdocumentation-pedantic ------------------------ Also controls `-Wdocumentation-unknown-command`_. **Diagnostic text:** +-----------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`whitespace is not allowed in parameter passing direction`| +-----------------------------------------------------------------------------------------------+ -Wdocumentation-unknown-command ------------------------------- **Diagnostic text:** +--------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`unknown command tag name '`:placeholder:`A`:diagtext:`'; did you mean '`:placeholder:`B`:diagtext:`'?`| +--------------------------------------------------------------------------------------------------------------------------------------------+ +---------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`unknown command tag name`| +---------------------------------------------------------------+ -Wdollar-in-identifier-extension -------------------------------- **Diagnostic text:** +--------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'$' in identifier`| +--------------------------------------------------------+ -Wdouble-promotion ------------------ **Diagnostic text:** +--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`implicit conversion increases floating-point precision:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`to` |nbsp| :placeholder:`B`| +--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wduplicate-decl-specifier -------------------------- This diagnostic is enabled by default. **Diagnostic text:** +-----------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`duplicate '`:placeholder:`A`:diagtext:`' declaration specifier`| +-----------------------------------------------------------------------------------------------------+ ++-------------------------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`multiple identical address spaces specified for type`| ++-------------------------------------------------------------------------------------------+ + +-----------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`duplicate '`:placeholder:`A`:diagtext:`' declaration specifier`| +-----------------------------------------------------------------------------------------------------+ -Wduplicate-enum ---------------- **Diagnostic text:** +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`element` |nbsp| :placeholder:`A` |nbsp| :diagtext:`has been implicitly assigned` |nbsp| :placeholder:`B` |nbsp| :diagtext:`which another element has been assigned`| +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wduplicate-method-arg ---------------------- **Diagnostic text:** +------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`redeclaration of method parameter` |nbsp| :placeholder:`A`| +------------------------------------------------------------------------------------------------+ -Wduplicate-method-match ------------------------ **Diagnostic text:** +-----------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`multiple declarations of method` |nbsp| :placeholder:`A` |nbsp| :diagtext:`found and ignored`| +-----------------------------------------------------------------------------------------------------------------------------------+ -Wduplicate-protocol -------------------- This diagnostic is enabled by default. **Diagnostic text:** +-----------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`duplicate protocol definition of` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is ignored`| +-----------------------------------------------------------------------------------------------------------------------------+ -Wdynamic-class-memaccess ------------------------- This diagnostic is enabled by default. **Diagnostic text:** +---------------------------+-------------------------------+------------------------------------------------------------------------------------------------+----------------------------------------+---------------------------------------------------------------------------------------------+-------------------------+ |:warning:`warning:` |nbsp| |+-----------------------------+| |nbsp| :diagtext:`this` |nbsp| :placeholder:`B` |nbsp| :diagtext:`call is a pointer to` |nbsp| |+--------------------------------------+|:diagtext:`dynamic class` |nbsp| :placeholder:`D`:diagtext:`; vtable pointer will be` |nbsp| |+-----------------------+| | ||:diagtext:`destination for` || || || ||:diagtext:`overwritten`|| | |+-----------------------------+| |+--------------------------------------+| |+-----------------------+| | ||:diagtext:`source of` || ||:diagtext:`class containing a` |nbsp| || ||:diagtext:`copied` || | |+-----------------------------+| |+--------------------------------------+| |+-----------------------+| | ||:diagtext:`first operand of` || | | ||:diagtext:`moved` || | |+-----------------------------+| | | |+-----------------------+| | ||:diagtext:`second operand of`|| | | ||:diagtext:`compared` || | |+-----------------------------+| | | |+-----------------------+| +---------------------------+-------------------------------+------------------------------------------------------------------------------------------------+----------------------------------------+---------------------------------------------------------------------------------------------+-------------------------+ -Wdynamic-exception-spec ------------------------ Some of the diagnostics controlled by this flag are enabled by default. Also controls `-Wdeprecated-dynamic-exception-spec`_. **Diagnostic text:** +--------------------------------------------------------------------------------------------+ |:error:`error:` |nbsp| :diagtext:`ISO C++17 does not allow dynamic exception specifications`| +--------------------------------------------------------------------------------------------+ -Weffc++ -------- Synonym for `-Wnon-virtual-dtor`_. -Wembedded-directive -------------------- **Diagnostic text:** +----------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`embedding a directive within macro arguments has undefined behavior`| +----------------------------------------------------------------------------------------------------------+ -Wempty-body ------------ This diagnostic is enabled by default. **Diagnostic text:** +--------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`for loop has empty body`| +--------------------------------------------------------------+ +------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`if statement has empty body`| +------------------------------------------------------------------+ +--------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`range-based for loop has empty body`| +--------------------------------------------------------------------------+ +----------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`switch statement has empty body`| +----------------------------------------------------------------------+ +----------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`while loop has empty body`| +----------------------------------------------------------------+ -Wempty-decomposition --------------------- This diagnostic is enabled by default. **Diagnostic text:** +-------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`ISO C++17 does not allow a decomposition group to be empty`| +-------------------------------------------------------------------------------------------------+ -Wempty-translation-unit ------------------------ **Diagnostic text:** +------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`ISO C requires a translation unit to contain at least one declaration`| +------------------------------------------------------------------------------------------------------------+ -Wencode-type ------------- This diagnostic is enabled by default. **Diagnostic text:** +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`encoding of` |nbsp| :placeholder:`A` |nbsp| :diagtext:`type is incomplete because` |nbsp| :placeholder:`B` |nbsp| :diagtext:`component has unknown encoding`| +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wendif-labels -------------- Synonym for `-Wextra-tokens`_. -Wenum-compare -------------- This diagnostic is enabled by default. Also controls `-Wenum-compare-switch`_. **Diagnostic text:** +------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`comparison of two values with different enumeration types`| +------------------------------------------------------------------------------------------------+ -Wenum-compare-switch --------------------- This diagnostic is enabled by default. **Diagnostic text:** +--------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`comparison of two values with different enumeration types in switch statement`| +--------------------------------------------------------------------------------------------------------------------+ -Wenum-conversion ----------------- This diagnostic is enabled by default. **Diagnostic text:** +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`implicit conversion from enumeration type` |nbsp| :placeholder:`A` |nbsp| :diagtext:`to different enumeration type` |nbsp| :placeholder:`B`| +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wenum-too-large ---------------- This diagnostic is enabled by default. **Diagnostic text:** +-----------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`enumeration values exceed range of largest integer`| +-----------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`incremented enumerator value` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is not representable in the largest integer type`| +---------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wexceptions ------------ This diagnostic is enabled by default. **Diagnostic text:** +--------------------------------------------------------------------------------------------------------+-------------------------+--------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`cannot refer to a non-static member from the handler of a` |nbsp| |+-----------------------+| |nbsp| :diagtext:`function try block`| | ||:diagtext:`constructor`|| | | |+-----------------------+| | | ||:diagtext:`destructor` || | | |+-----------------------+| | +--------------------------------------------------------------------------------------------------------+-------------------------+--------------------------------------+ +-------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`exception of type` |nbsp| :placeholder:`A` |nbsp| :diagtext:`will be caught by earlier handler`| +-------------------------------------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`has a non-throwing exception specification but can still throw`| +-----------------------------------------------------------------------------------------------------------------------------+ -Wexit-time-destructors ----------------------- **Diagnostic text:** +-----------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`declaration requires an exit-time destructor`| +-----------------------------------------------------------------------------------+ -Wexpansion-to-defined ---------------------- Some of the diagnostics controlled by this flag are enabled by default. **Diagnostic text:** +-------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`macro expansion producing 'defined' has undefined behavior`| +-------------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`macro expansion producing 'defined' has undefined behavior`| +-------------------------------------------------------------------------------------------------+ +-Wexperimental-isel +------------------- +This diagnostic is enabled by default. + +**Diagnostic text:** + ++------------------------------------------------------------------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`-fexperimental-isel support for the '`:placeholder:`A`:diagtext:`' architecture is incomplete`| ++------------------------------------------------------------------------------------------------------------------------------------+ + ++----------------------------------------------------------------------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`-fexperimental-isel support is incomplete for this architecture at the current optimization level`| ++----------------------------------------------------------------------------------------------------------------------------------------+ + + -Wexplicit-initialize-call -------------------------- This diagnostic is enabled by default. **Diagnostic text:** +------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`explicit call to +initialize results in duplicate call to +initialize`| +------------------------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`explicit call to \[super initialize\] should only be in implementation of +initialize`| +----------------------------------------------------------------------------------------------------------------------------+ -Wexplicit-ownership-type ------------------------- **Diagnostic text:** +-------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`method parameter of type` |nbsp| :placeholder:`A` |nbsp| :diagtext:`with no explicit ownership`| +-------------------------------------------------------------------------------------------------------------------------------------+ --Wextended-offsetof -------------------- -**Diagnostic text:** - -+--------------------------------------------------------------------------------------+ -|:warning:`warning:` |nbsp| :diagtext:`using extended field designator is an extension`| -+--------------------------------------------------------------------------------------+ - - -Wextern-c-compat ----------------- This diagnostic is enabled by default. **Diagnostic text:** +---------------------------+---------------------------+--------------------+--------------------------------------------+---------------------------+--------------------------+ |:warning:`warning:` |nbsp| |+-------------------------+|+------------------+| |nbsp| :diagtext:`has size 0 in C,` |nbsp| |+-------------------------+| |nbsp| :diagtext:`in C++`| | || |||:diagtext:`struct`|| ||:diagtext:`size 1` || | | |+-------------------------+|+------------------+| |+-------------------------+| | | ||:diagtext:`empty` |nbsp| |||:diagtext:`union` || ||:diagtext:`non-zero size`|| | | |+-------------------------+|+------------------+| |+-------------------------+| | +---------------------------+---------------------------+--------------------+--------------------------------------------+---------------------------+--------------------------+ -Wextern-initializer -------------------- This diagnostic is enabled by default. **Diagnostic text:** +---------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'extern' variable has an initializer`| +---------------------------------------------------------------------------+ -Wextra ------- Some of the diagnostics controlled by this flag are enabled by default. Also controls `-Wignored-qualifiers`_, `-Winitializer-overrides`_, `-Wmissing-field-initializers`_, `-Wmissing-method-return-type`_, `-Wnull-pointer-arithmetic`_, `-Wsemicolon-before-method-body`_, `-Wsign-compare`_, `-Wunused-parameter`_. **Diagnostic text:** +-----------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`call to function without interrupt attribute could clobber interruptee's VFP registers`| +-----------------------------------------------------------------------------------------------------------------------------+ -Wextra-qualification --------------------- This diagnostic is enabled by default. **Diagnostic text:** +--------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`extra qualification on member` |nbsp| :placeholder:`A`| +--------------------------------------------------------------------------------------------+ -Wextra-semi ------------ -Also controls `-Wc++11-extra-semi`_. +Also controls `-Wc++11-extra-semi`_, `-Wc++98-compat-extra-semi`_. **Diagnostic text:** +--------------------------------------------------------+------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`extra ';'` |nbsp| |+----------------------------------------------+| | ||:diagtext:`outside of a function` || | |+----------------------------------------------+| | ||+--------------------------------------------+|| | |||:diagtext:`inside a` |nbsp| :placeholder:`B`||| | ||+--------------------------------------------+|| | |+----------------------------------------------+| | ||:diagtext:`inside instance variable list` || | |+----------------------------------------------+| | ||:diagtext:`after member function definition` || | |+----------------------------------------------+| +--------------------------------------------------------+------------------------------------------------+ +---------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`extra ';' after member function definition`| +---------------------------------------------------------------------------------+ -Wextra-tokens -------------- This diagnostic is enabled by default. **Diagnostic text:** +------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`extra tokens at end of #`:placeholder:`A` |nbsp| :diagtext:`directive`| +------------------------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`extra tokens at the end of '#pragma omp` |nbsp| :placeholder:`A`:diagtext:`' are ignored`| +-------------------------------------------------------------------------------------------------------------------------------+ -Wfallback ---------- This diagnostic is enabled by default. **Diagnostic text:** +------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`falling back to` |nbsp| :placeholder:`A`| +------------------------------------------------------------------------------+ -Wflag-enum ----------- This diagnostic is enabled by default. **Diagnostic text:** +------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`enumeration value` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is out of range of flags in enumeration type` |nbsp| :placeholder:`B`| +------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wflexible-array-extensions --------------------------- **Diagnostic text:** +-------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`may not be used as an array element due to flexible array member`| +-------------------------------------------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`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:`warning:` |nbsp| :diagtext:`implicit conversion turns floating-point number into integer:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`to` |nbsp| :placeholder:`B`| +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wfloat-equal ------------- **Diagnostic text:** +---------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`comparing floating point with == or != is unsafe`| +---------------------------------------------------------------------------------------+ -Wfloat-overflow-conversion --------------------------- **Diagnostic text:** -+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -|:warning:`warning:` |nbsp| :diagtext:`implicit conversion of out of range value from` |nbsp| :placeholder:`A` |nbsp| :diagtext:`to` |nbsp| :placeholder:`B` |nbsp| :diagtext:`changes value from` |nbsp| :placeholder:`C` |nbsp| :diagtext:`to` |nbsp| :placeholder:`D`| -+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ ++-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`implicit conversion from` |nbsp| :placeholder:`A` |nbsp| :diagtext:`to` |nbsp| :placeholder:`B` |nbsp| :diagtext:`changes value from` |nbsp| :placeholder:`C` |nbsp| :diagtext:`to` |nbsp| :placeholder:`D`| ++-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ ++-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`implicit conversion of out of range value from` |nbsp| :placeholder:`A` |nbsp| :diagtext:`to` |nbsp| :placeholder:`B` |nbsp| :diagtext:`is undefined`| ++-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + -Wfloat-zero-conversion ----------------------- **Diagnostic text:** +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`implicit conversion from` |nbsp| :placeholder:`A` |nbsp| :diagtext:`to` |nbsp| :placeholder:`B` |nbsp| :diagtext:`changes non-zero value from` |nbsp| :placeholder:`C` |nbsp| :diagtext:`to` |nbsp| :placeholder:`D`| +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wfor-loop-analysis ------------------- **Diagnostic text:** +-----------------------------------------------------------------------------------------------------+-------------------------+----------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`variable` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is` |nbsp| |+-----------------------+| |nbsp| :diagtext:`both in the loop header and in the loop body`| | ||:diagtext:`decremented`|| | | |+-----------------------+| | | ||:diagtext:`incremented`|| | | |+-----------------------+| | +-----------------------------------------------------------------------------------------------------+-------------------------+----------------------------------------------------------------+ +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`variable`|+----------------------------------------------------------------------------------------------------------------------------------------------------------+| |nbsp| :diagtext:`used in loop condition not modified in loop body`| | ||:diagtext:`s` || | | |+----------------------------------------------------------------------------------------------------------------------------------------------------------+| | | ||+------------------------+ || | | ||| |nbsp| :placeholder:`B`| || | | ||+------------------------+ || | | |+----------------------------------------------------------------------------------------------------------------------------------------------------------+| | | ||+------------------------------------------------------------------------------------+ || | | |||:diagtext:`s` |nbsp| :placeholder:`B` |nbsp| :diagtext:`and` |nbsp| :placeholder:`C`| || | | ||+------------------------------------------------------------------------------------+ || | | |+----------------------------------------------------------------------------------------------------------------------------------------------------------+| | | ||+-------------------------------------------------------------------------------------------------------------------+ || | | |||:diagtext:`s` |nbsp| :placeholder:`B`:diagtext:`,` |nbsp| :placeholder:`C`:diagtext:`, and` |nbsp| :placeholder:`D`| || | | ||+-------------------------------------------------------------------------------------------------------------------+ || | | |+----------------------------------------------------------------------------------------------------------------------------------------------------------+| | | ||+--------------------------------------------------------------------------------------------------------------------------------------------------------+|| | | |||:diagtext:`s` |nbsp| :placeholder:`B`:diagtext:`,` |nbsp| :placeholder:`C`:diagtext:`,` |nbsp| :placeholder:`D`:diagtext:`, and` |nbsp| :placeholder:`E`||| | | ||+--------------------------------------------------------------------------------------------------------------------------------------------------------+|| | | |+----------------------------------------------------------------------------------------------------------------------------------------------------------+| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------+ -Wformat -------- This diagnostic is enabled by default. Also controls `-Wformat-extra-args`_, `-Wformat-invalid-specifier`_, `-Wformat-security`_, `-Wformat-y2k`_, `-Wformat-zero-length`_, `-Wnonnull`_. **Diagnostic text:** +-------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`using '%%P' format specifier without precision`| +-------------------------------------------------------------------------------------+ +---------------------------+----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| |+--------------------------------------------+| |nbsp| :diagtext:`'`:placeholder:`A`:diagtext:`' should not be used as format arguments; add an explicit cast to` |nbsp| :placeholder:`B` |nbsp| :diagtext:`instead`| | ||:diagtext:`values of type` || | | |+--------------------------------------------+| | | ||:diagtext:`enum values with underlying type`|| | | |+--------------------------------------------+| | +---------------------------+----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------------------------------------------------------+-----------------------------+------------------------+ |:warning:`warning:` |nbsp| :diagtext:`format specifies type` |nbsp| :placeholder:`A` |nbsp| :diagtext:`but the argument has` |nbsp| |+---------------------------+| |nbsp| :placeholder:`B`| | ||:diagtext:`type` || | | |+---------------------------+| | | ||:diagtext:`underlying type`|| | | |+---------------------------+| | +------------------------------------------------------------------------------------------------------------------------------------+-----------------------------+------------------------+ +----------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`using '`:placeholder:`A`:diagtext:`' format specifier annotation outside of os\_log()/os\_trace()`| +----------------------------------------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------+-----------------------------+ |:warning:`warning:` |nbsp| :diagtext:`invalid position specified for` |nbsp| |+---------------------------+| | ||:diagtext:`field width` || | |+---------------------------+| | ||:diagtext:`field precision`|| | |+---------------------------+| +-----------------------------------------------------------------------------+-----------------------------+ +----------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`cannot mix positional and non-positional arguments in format string`| +----------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`length modifier '`:placeholder:`A`:diagtext:`' results in undefined behavior or no effect with '`:placeholder:`B`:diagtext:`' conversion specifier`| +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`format string should not be a wide string`| +--------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`position arguments in format strings start counting at 1 (not 0)`| +-------------------------------------------------------------------------------------------------------+ +------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`format string missing`| +------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`object format flags cannot be used with '`:placeholder:`A`:diagtext:`' conversion specifier`| +----------------------------------------------------------------------------------------------------------------------------------+ +----------------------------------------+-----------------+-------------------------------------+-----------------------+--------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'`|+---------------+|:diagtext:`' specified field` |nbsp| |+---------------------+| |nbsp| :diagtext:`is missing a matching 'int' argument`| | ||:diagtext:`\*` || ||:diagtext:`width` || | | |+---------------+| |+---------------------+| | | ||:diagtext:`.\*`|| ||:diagtext:`precision`|| | | |+---------------+| |+---------------------+| | +----------------------------------------+-----------------+-------------------------------------+-----------------------+--------------------------------------------------------+ +----------------------------------------------------+-----------------------+-----------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`field` |nbsp| |+---------------------+| |nbsp| :diagtext:`should have type` |nbsp| :placeholder:`B`:diagtext:`, but argument has type` |nbsp| :placeholder:`C`| | ||:diagtext:`width` || | | |+---------------------+| | | ||:diagtext:`precision`|| | | |+---------------------+| | +----------------------------------------------------+-----------------------+-----------------------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`missing object format flag`| +-----------------------------------------------------------------+ +------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`format string contains '\\0' within the string body`| +------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`format string is not null-terminated`| +---------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`flag '`:placeholder:`A`:diagtext:`' is ignored when flag '`:placeholder:`B`:diagtext:`' is present`| +-----------------------------------------------------------------------------------------------------------------------------------------+ +------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`incomplete format specifier`| +------------------------------------------------------------------+ +--------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`more '%%' conversions than data arguments`| +--------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'`:placeholder:`A`:diagtext:`' is not a valid object format flag`| +-------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`flag '`:placeholder:`A`:diagtext:`' results in undefined behavior with '`:placeholder:`B`:diagtext:`' conversion specifier`| +-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ +---------------------------+-------------------------+------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| |+-----------------------+| |nbsp| :diagtext:`used with '`:placeholder:`B`:diagtext:`' conversion specifier, resulting in undefined behavior`| | ||:diagtext:`field width`|| | | |+-----------------------+| | | ||:diagtext:`precision` || | | |+-----------------------+| | +---------------------------+-------------------------+------------------------------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`data argument position '`:placeholder:`A`:diagtext:`' exceeds the number of data arguments (`:placeholder:`B`:diagtext:`)`| +----------------------------------------------------------------------------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`zero field width in scanf format string is unused`| +----------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`no closing '\]' for '%%\[' in scanf format string`| +----------------------------------------------------------------------------------------+ -Wformat-extra-args ------------------- This diagnostic is enabled by default. **Diagnostic text:** +------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`data argument not used by format string`| +------------------------------------------------------------------------------+ -Wformat-invalid-specifier -------------------------- This diagnostic is enabled by default. **Diagnostic text:** +--------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`invalid conversion specifier '`:placeholder:`A`:diagtext:`'`| +--------------------------------------------------------------------------------------------------+ -Wformat-non-iso ---------------- **Diagnostic text:** +-----------------------------------------------------------------------------+----------------------------------+---------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'`:placeholder:`A`:diagtext:`'` |nbsp| |+--------------------------------+| |nbsp| :diagtext:`is not supported by ISO C`| | ||:diagtext:`length modifier` || | | |+--------------------------------+| | | ||:diagtext:`conversion specifier`|| | | |+--------------------------------+| | +-----------------------------------------------------------------------------+----------------------------------+---------------------------------------------+ +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`using length modifier '`:placeholder:`A`:diagtext:`' with conversion specifier '`:placeholder:`B`:diagtext:`' is not supported by ISO C`| +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`positional arguments are not supported by ISO C`| +--------------------------------------------------------------------------------------+ -Wformat-nonliteral ------------------- **Diagnostic text:** +----------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`format string is not a string literal`| +----------------------------------------------------------------------------+ -Wformat-pedantic ----------------- **Diagnostic text:** ++---------------------------+----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| |+--------------------------------------------+| |nbsp| :diagtext:`'`:placeholder:`A`:diagtext:`' should not be used as format arguments; add an explicit cast to` |nbsp| :placeholder:`B` |nbsp| :diagtext:`instead`| +| ||:diagtext:`values of type` || | +| |+--------------------------------------------+| | +| ||:diagtext:`enum values with underlying type`|| | +| |+--------------------------------------------+| | ++---------------------------+----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +------------------------------------------------------------------------------------------------------------------------------------+-----------------------------+------------------------+ |:warning:`warning:` |nbsp| :diagtext:`format specifies type` |nbsp| :placeholder:`A` |nbsp| :diagtext:`but the argument has` |nbsp| |+---------------------------+| |nbsp| :placeholder:`B`| | ||:diagtext:`type` || | | |+---------------------------+| | | ||:diagtext:`underlying type`|| | | |+---------------------------+| | +------------------------------------------------------------------------------------------------------------------------------------+-----------------------------+------------------------+ -Wformat-security ----------------- This diagnostic is enabled by default. **Diagnostic text:** +---------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`format string is not a string literal (potentially insecure)`| +---------------------------------------------------------------------------------------------------+ -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:`warning:` |nbsp| :diagtext:`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`_. -Wfour-char-constants --------------------- **Diagnostic text:** +-------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`multi-character character constant`| +-------------------------------------------------------------------------+ -Wframe-larger-than= -------------------- This diagnostic is enabled by default. **Diagnostic text:** The text of this diagnostic is not controlled by Clang. +--------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`stack frame size of` |nbsp| :placeholder:`A` |nbsp| :diagtext:`bytes in` |nbsp| :placeholder:`B`| +--------------------------------------------------------------------------------------------------------------------------------------+ +-Wframework-include-private-from-public +--------------------------------------- +This diagnostic is enabled by default. + +**Diagnostic text:** + ++-------------------------------------------------------------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`public framework header includes private framework header '`:placeholder:`A`:diagtext:`'`| ++-------------------------------------------------------------------------------------------------------------------------------+ + + -Wfunction-def-in-objc-container -------------------------------- This diagnostic is enabled by default. **Diagnostic text:** +--------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`function definition inside an Objective-C container is deprecated`| +--------------------------------------------------------------------------------------------------------+ +-Wfunction-multiversion +----------------------- +This diagnostic is enabled by default. + +**Diagnostic text:** + ++-------------------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`body of cpu\_dispatch function will be ignored`| ++-------------------------------------------------------------------------------------+ + ++---------------------------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`CPU list contains duplicate entries; attribute ignored`| ++---------------------------------------------------------------------------------------------+ + + -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:`warning:` |nbsp| :diagtext:`'diagnose\_if' is a clang extension`| +--------------------------------------------------------------------------+ +------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'enable\_if' is a clang extension`| +------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`\_\_final is a GNU extension, consider using C++11 final`| +-----------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`GCC does not allow` |nbsp| :placeholder:`A` |nbsp| :diagtext:`attribute in this position on a function definition`| +--------------------------------------------------------------------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'break' is bound to loop, GCC binds it to switch`| +---------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`GCC does not allow the 'cleanup' attribute argument to be anything other than a simple identifier`| +----------------------------------------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`GCC does not allow an attribute in this position on a function declaration`| +-----------------------------------------------------------------------------------------------------------------+ ++------------------------------------------------------------------------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`GCC does not allow the` |nbsp| :placeholder:`A` |nbsp| :diagtext:`attribute to be written on a type`| ++------------------------------------------------------------------------------------------------------------------------------------------+ + ++-------------------------------------------------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`GCC does not allow variable declarations in for loop initializers before C99`| ++-------------------------------------------------------------------------------------------------------------------+ + +----------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'`:placeholder:`A`:diagtext:`' is bound to current loop, GCC binds it to the enclosing loop`| +----------------------------------------------------------------------------------------------------------------------------------+ -Wglobal-constructors --------------------- **Diagnostic text:** +--------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`declaration requires a global constructor`| +--------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`declaration requires a global destructor`| +-------------------------------------------------------------------------------+ -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-initializer`_, `-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-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:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`applied to an expression is a GNU extension`| +----------------------------------------------------------------------------------------------------------+ -Wgnu-anonymous-struct ---------------------- **Diagnostic text:** +----------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`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:`error:` |nbsp| :diagtext:`parenthesized initialization of a member array is a GNU extension`| +----------------------------------------------------------------------------------------------------+ -Wgnu-auto-type --------------- **Diagnostic text:** +--------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'\_\_auto\_type' is a GNU extension`| +--------------------------------------------------------------------------+ -Wgnu-binary-literal -------------------- **Diagnostic text:** +----------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`binary integer literals are a GNU extension`| +----------------------------------------------------------------------------------+ -Wgnu-case-range ---------------- **Diagnostic text:** +----------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`use of GNU case range extension`| +----------------------------------------------------------------------+ -Wgnu-complex-integer --------------------- **Diagnostic text:** +--------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`complex integer types are a GNU extension`| +--------------------------------------------------------------------------------+ -Wgnu-compound-literal-initializer ---------------------------------- **Diagnostic text:** +--------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`initialization of an array` |nbsp| :diagtext:`from a compound literal` |nbsp| :diagtext:`is a GNU extension`| +--------------------------------------------------------------------------------------------------------------------------------------------------+ -Wgnu-conditional-omitted-operand --------------------------------- **Diagnostic text:** +--------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`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:`warning:` |nbsp| :diagtext:`use of GNU array range extension`| +-----------------------------------------------------------------------+ +-------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`use of GNU 'missing =' extension in designator`| +-------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`use of GNU old-style field designator extension`| +--------------------------------------------------------------------------------------+ -Wgnu-empty-initializer ----------------------- **Diagnostic text:** +-----------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`use of GNU empty initializer extension`| +-----------------------------------------------------------------------------+ -Wgnu-empty-struct ------------------ **Diagnostic text:** +----------------------------------------------------+--------------------+--------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`empty` |nbsp| |+------------------+| |nbsp| :diagtext:`is a GNU extension`| | ||:diagtext:`struct`|| | | |+------------------+| | | ||:diagtext:`union` || | | |+------------------+| | +----------------------------------------------------+--------------------+--------------------------------------+ +----------------------------------------------------------------------------------------------------------------------------------+-----------------------+--------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`flexible array member` |nbsp| :placeholder:`A` |nbsp| :diagtext:`in otherwise empty` |nbsp| |+---------------------+| |nbsp| :diagtext:`is a GNU extension`| | ||:diagtext:`struct` || | | |+---------------------+| | | ||:diagtext:`interface`|| | | |+---------------------+| | | ||:diagtext:`union` || | | |+---------------------+| | | ||:diagtext:`class` || | | |+---------------------+| | | ||:diagtext:`enum` || | | |+---------------------+| | +----------------------------------------------------------------------------------------------------------------------------------+-----------------------+--------------------------------------+ +---------------------------+--------------------+------------------------------------------------------------+ |:warning:`warning:` |nbsp| |+------------------+| |nbsp| :diagtext:`without named members is a GNU extension`| | ||:diagtext:`struct`|| | | |+------------------+| | | ||:diagtext:`union` || | | |+------------------+| | +---------------------------+--------------------+------------------------------------------------------------+ -Wgnu-flexible-array-initializer -------------------------------- **Diagnostic text:** +---------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`flexible array initialization is a GNU extension`| +---------------------------------------------------------------------------------------+ -Wgnu-flexible-array-union-member --------------------------------- **Diagnostic text:** +-------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`flexible array member` |nbsp| :placeholder:`A` |nbsp| :diagtext:`in a union is a GNU extension`| +-------------------------------------------------------------------------------------------------------------------------------------+ -Wgnu-folding-constant ---------------------- **Diagnostic text:** +-------------------------------------------------------------------+----------------------+------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`expression is not an` |nbsp| |+--------------------+| |nbsp| :diagtext:`constant expression; folding it to a constant is a GNU extension`| | ||:diagtext:`integer` || | | |+--------------------+| | | ||:diagtext:`integral`|| | | |+--------------------+| | +-------------------------------------------------------------------+----------------------+------------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`in-class initializer for static data member is not a constant expression; folding it to a constant is a GNU extension`| +------------------------------------------------------------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`variable length array folded to constant array as an extension`| +-----------------------------------------------------------------------------------------------------+ -Wgnu-imaginary-constant ------------------------ **Diagnostic text:** +------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`imaginary constants are a GNU extension`| +------------------------------------------------------------------------------+ -Wgnu-include-next ------------------ **Diagnostic text:** +-----------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`#include\_next is a language extension`| +-----------------------------------------------------------------------------+ -Wgnu-label-as-value -------------------- **Diagnostic text:** +----------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`use of GNU address-of-label extension`| +----------------------------------------------------------------------------+ +-------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`use of GNU indirect-goto extension`| +-------------------------------------------------------------------------+ -Wgnu-redeclared-enum --------------------- **Diagnostic text:** +------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`redeclaration of already-defined enum` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is a GNU extension`| +------------------------------------------------------------------------------------------------------------------------------------------+ -Wgnu-statement-expression -------------------------- **Diagnostic text:** +--------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`use of GNU statement expression extension`| +--------------------------------------------------------------------------------+ -Wgnu-static-float-init ----------------------- This diagnostic is enabled by default. **Diagnostic text:** +--------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`in-class initializer for static data member of type` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is a GNU extension`| +--------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wgnu-string-literal-operator-template -------------------------------------- This diagnostic is enabled by default. **Diagnostic text:** +--------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`string literal operator templates are a GNU extension`| +--------------------------------------------------------------------------------------------+ -Wgnu-union-cast ---------------- **Diagnostic text:** +----------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`cast to union type is a GNU extension`| +----------------------------------------------------------------------------+ -Wgnu-variable-sized-type-not-at-end ------------------------------------ This diagnostic is enabled by default. **Diagnostic text:** +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`field` |nbsp| :placeholder:`A` |nbsp| :diagtext:`with variable sized type` |nbsp| :placeholder:`B` |nbsp| :diagtext:`not at the end of a struct or class is a GNU extension`| +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wgnu-zero-line-directive ------------------------- **Diagnostic text:** +--------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`#line directive with zero argument is a GNU extension`| +--------------------------------------------------------------------------------------------+ -Wgnu-zero-variadic-macro-arguments ----------------------------------- **Diagnostic text:** +---------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`must specify at least one argument for '...' parameter of variadic macro`| +---------------------------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`token pasting of ',' and \_\_VA\_ARGS\_\_ is a GNU extension`| +---------------------------------------------------------------------------------------------------+ -Wheader-guard -------------- This diagnostic is enabled by default. **Diagnostic text:** +---------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is used as a header guard here, followed by #define of a different macro`| +---------------------------------------------------------------------------------------------------------------------------------------+ -Wheader-hygiene ---------------- **Diagnostic text:** +--------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`using namespace directive in global context in header`| +--------------------------------------------------------------------------------------------+ -Widiomatic-parentheses ----------------------- **Diagnostic text:** +-----------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`using the result of an assignment as a condition without parentheses`| +-----------------------------------------------------------------------------------------------------------+ -Wignored-attributes -------------------- This diagnostic is enabled by default. **Diagnostic text:** ++--------------------------------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`'trivial\_abi' cannot be applied to` |nbsp| :placeholder:`A`| ++--------------------------------------------------------------------------------------------------+ + +---------------------------+-------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| |+-----------------+| |nbsp| :diagtext:`will always resolve to` |nbsp| :placeholder:`A` |nbsp| :diagtext:`even if weak definition of` |nbsp| :placeholder:`B` |nbsp| :diagtext:`is overridden`| | ||:diagtext:`alias`|| | | |+-----------------+| | | ||:diagtext:`ifunc`|| | | |+-----------------+| | +---------------------------+-------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +---------------------------+-------------------+----------------------------------------------------------------------------------------------------------------+----------------------+ |:warning:`warning:` |nbsp| |+-----------------+| |nbsp| :diagtext:`will not be in section '`:placeholder:`A`:diagtext:`' but in the same section as the` |nbsp| |+--------------------+| | ||:diagtext:`alias`|| ||:diagtext:`aliasee` || | |+-----------------+| |+--------------------+| | ||:diagtext:`ifunc`|| ||:diagtext:`resolver`|| | |+-----------------+| |+--------------------+| +---------------------------+-------------------+----------------------------------------------------------------------------------------------------------------+----------------------+ +----------------------------------------------------------------------+------------------------+-------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'abi\_tag' attribute on` |nbsp| |+----------------------+| |nbsp| :diagtext:`namespace ignored`| | ||:diagtext:`non-inline`|| | | |+----------------------+| | | ||:diagtext:`anonymous` || | | |+----------------------+| | +----------------------------------------------------------------------+------------------------+-------------------------------------+ +-----------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`attribute` |nbsp| :placeholder:`A` |nbsp| :diagtext:`after definition is ignored`| +-----------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`attribute can only be applied to instance variables or properties`| +--------------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`attribute ignored`| +--------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`attribute ignored for field of type` |nbsp| :placeholder:`B`| +--------------------------------------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`attribute ignored on inline function`| +---------------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'`:placeholder:`A`:diagtext:`' attribute cannot be specified on a definition`| +-------------------------------------------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`attribute` |nbsp| :placeholder:`A` |nbsp| :diagtext:`ignored, because it is not attached to a declaration`| +------------------------------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'nonnull' attribute applied to function with no pointer arguments`| +--------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'nonnull' attribute when used on parameters takes no arguments`| +-----------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`attribute ignored when parsing type`| +--------------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`attribute only applies to a pointer or reference (`:placeholder:`B` |nbsp| :diagtext:`is invalid)`| +----------------------------------------------------------------------------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------+------------------------------+-------------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`attribute only applies to`|+----------------------------+| |nbsp| :diagtext:`pointer arguments`| | || || | | |+----------------------------+| | | || |nbsp| :diagtext:`constant`|| | | |+----------------------------+| | +----------------------------------------------------------------------------------------+------------------------------+-------------------------------------+ +------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`attribute declaration must precede definition`| +------------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`attribute only applies to return values that are pointers`| +------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`attribute only applies to return values that are pointers or references`| +--------------------------------------------------------------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'sentinel' attribute requires named arguments`| +------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------+-----------------------+ |:warning:`warning:` |nbsp| :diagtext:`'sentinel' attribute only supported for variadic` |nbsp| |+---------------------+| | ||:diagtext:`functions`|| | |+---------------------+| | ||:diagtext:`blocks` || | |+---------------------+| +-----------------------------------------------------------------------------------------------+-----------------------+ +------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`attribute argument not supported:` |nbsp| :placeholder:`B`| +------------------------------------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`unknown visibility` |nbsp| :placeholder:`A`| +---------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------------------------------------------+--------------------------------+----------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`attribute` |nbsp| :placeholder:`A` |nbsp| :diagtext:`cannot be applied to` |nbsp| |+------------------------------+| |nbsp| :diagtext:`without return value`| | ||:diagtext:`functions` || | | |+------------------------------+| | | ||:diagtext:`Objective-C method`|| | | |+------------------------------+| | +------------------------------------------------------------------------------------------------------------------------+--------------------------------+----------------------------------------+ +----------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`\_\_weak attribute cannot be specified on a field declaration`| +----------------------------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`\_\_weak attribute cannot be specified on an automatic variable when ARC is not enabled`| +------------------------------------------------------------------------------------------------------------------------------+ -+------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ -|:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`attribute only applies to` |nbsp| |+----------------------------------------------------------------------------------------------------------------+| -| ||:diagtext:`functions` || -| |+----------------------------------------------------------------------------------------------------------------+| -| ||:diagtext:`unions` || -| |+----------------------------------------------------------------------------------------------------------------+| -| ||:diagtext:`variables and functions` || -| |+----------------------------------------------------------------------------------------------------------------+| -| ||:diagtext:`functions and global variables` || -| |+----------------------------------------------------------------------------------------------------------------+| -| ||:diagtext:`functions, variables, and Objective-C interfaces` || -| |+----------------------------------------------------------------------------------------------------------------+| -| ||:diagtext:`functions and methods` || -| |+----------------------------------------------------------------------------------------------------------------+| -| ||:diagtext:`parameters` || -| |+----------------------------------------------------------------------------------------------------------------+| -| ||:diagtext:`functions, methods and blocks` || -| |+----------------------------------------------------------------------------------------------------------------+| -| ||:diagtext:`functions, methods, and classes` || -| |+----------------------------------------------------------------------------------------------------------------+| -| ||:diagtext:`functions, methods, and parameters` || -| |+----------------------------------------------------------------------------------------------------------------+| -| ||:diagtext:`functions, methods, and global variables` || -| |+----------------------------------------------------------------------------------------------------------------+| -| ||:diagtext:`classes` || -| |+----------------------------------------------------------------------------------------------------------------+| -| ||:diagtext:`enums` || -| |+----------------------------------------------------------------------------------------------------------------+| -| ||:diagtext:`variables` || -| |+----------------------------------------------------------------------------------------------------------------+| -| ||:diagtext:`methods` || -| |+----------------------------------------------------------------------------------------------------------------+| -| ||:diagtext:`fields and global variables` || -| |+----------------------------------------------------------------------------------------------------------------+| -| ||:diagtext:`structs` || -| |+----------------------------------------------------------------------------------------------------------------+| -| ||:diagtext:`parameters and typedefs` || -| |+----------------------------------------------------------------------------------------------------------------+| -| ||:diagtext:`variables and typedefs` || -| |+----------------------------------------------------------------------------------------------------------------+| -| ||:diagtext:`thread-local variables` || -| |+----------------------------------------------------------------------------------------------------------------+| -| ||:diagtext:`variables and fields` || -| |+----------------------------------------------------------------------------------------------------------------+| -| ||:diagtext:`variables, data members and tag types` || -| |+----------------------------------------------------------------------------------------------------------------+| -| ||:diagtext:`types and namespaces` || -| |+----------------------------------------------------------------------------------------------------------------+| -| ||:diagtext:`Objective-C interfaces` || -| |+----------------------------------------------------------------------------------------------------------------+| -| ||:diagtext:`methods and properties` || -| |+----------------------------------------------------------------------------------------------------------------+| -| ||:diagtext:`functions, methods, and properties` || -| |+----------------------------------------------------------------------------------------------------------------+| -| ||:diagtext:`struct or union` || -| |+----------------------------------------------------------------------------------------------------------------+| -| ||:diagtext:`struct, union or class` || -| |+----------------------------------------------------------------------------------------------------------------+| -| ||:diagtext:`types` || -| |+----------------------------------------------------------------------------------------------------------------+| -| ||:diagtext:`Objective-C instance methods` || -| |+----------------------------------------------------------------------------------------------------------------+| -| ||:diagtext:`init methods of interface or class extension declarations` || -| |+----------------------------------------------------------------------------------------------------------------+| -| ||:diagtext:`variables, functions and classes` || -| |+----------------------------------------------------------------------------------------------------------------+| -| ||:diagtext:`functions, variables, classes, and Objective-C interfaces` || -| |+----------------------------------------------------------------------------------------------------------------+| -| ||:diagtext:`Objective-C protocols` || -| |+----------------------------------------------------------------------------------------------------------------+| -| ||:diagtext:`variables with static or thread storage duration` || -| |+----------------------------------------------------------------------------------------------------------------+| -| ||:diagtext:`functions, methods, properties, and global variables` || -| |+----------------------------------------------------------------------------------------------------------------+| -| ||:diagtext:`structs, unions, and typedefs` || -| |+----------------------------------------------------------------------------------------------------------------+| -| ||:diagtext:`structs and typedefs` || -| |+----------------------------------------------------------------------------------------------------------------+| -| ||:diagtext:`interface or protocol declarations` || -| |+----------------------------------------------------------------------------------------------------------------+| -| ||:diagtext:`kernel functions` || -| |+----------------------------------------------------------------------------------------------------------------+| -| ||:diagtext:`non-K&R-style functions` || -| |+----------------------------------------------------------------------------------------------------------------+| -| ||:diagtext:`variables, enums, fields and typedefs` || -| |+----------------------------------------------------------------------------------------------------------------+| -| ||:diagtext:`functions, methods, enums, and classes` || -| |+----------------------------------------------------------------------------------------------------------------+| -| ||:diagtext:`structs, classes, variables, functions, and inline namespaces` || -| |+----------------------------------------------------------------------------------------------------------------+| -| ||:diagtext:`variables, functions, methods, types, enumerations, enumerators, labels, and non-static data members`|| -| |+----------------------------------------------------------------------------------------------------------------+| -| ||:diagtext:`classes and enumerations` || -| |+----------------------------------------------------------------------------------------------------------------+| -| ||:diagtext:`named declarations` || -| |+----------------------------------------------------------------------------------------------------------------+| -+------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ ++------------------------------------------------------------------------------------------------+---------------------------------------------------+ +|:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`attribute only applies to` |nbsp| |+-------------------------------------------------+| +| ||:diagtext:`functions` || +| |+-------------------------------------------------+| +| ||:diagtext:`unions` || +| |+-------------------------------------------------+| +| ||:diagtext:`variables and functions` || +| |+-------------------------------------------------+| +| ||:diagtext:`functions and methods` || +| |+-------------------------------------------------+| +| ||:diagtext:`functions, methods and blocks` || +| |+-------------------------------------------------+| +| ||:diagtext:`functions, methods, and parameters` || +| |+-------------------------------------------------+| +| ||:diagtext:`variables` || +| |+-------------------------------------------------+| +| ||:diagtext:`variables and fields` || +| |+-------------------------------------------------+| +| ||:diagtext:`variables, data members and tag types`|| +| |+-------------------------------------------------+| +| ||:diagtext:`types and namespaces` || +| |+-------------------------------------------------+| +| ||:diagtext:`variables, functions and classes` || +| |+-------------------------------------------------+| +| ||:diagtext:`kernel functions` || +| |+-------------------------------------------------+| +| ||:diagtext:`non-K&R-style functions` || +| |+-------------------------------------------------+| ++------------------------------------------------------------------------------------------------+---------------------------------------------------+ ++----------------------------------------------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`attribute only applies to` |nbsp| :placeholder:`B`| ++----------------------------------------------------------------------------------------------------------------+ + +--------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`attribute` |nbsp| :placeholder:`A` |nbsp| :diagtext:`ignored, because it cannot be applied to omitted return type`| +--------------------------------------------------------------------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`calling convention` |nbsp| :placeholder:`A` |nbsp| :diagtext:`ignored for this target`| +----------------------------------------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`calling convention ignored on constructor/destructor`| +-------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`calling convention ignored on variadic function`| +--------------------------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`attribute` |nbsp| :placeholder:`A` |nbsp| :diagtext:`ignored, because it cannot be applied to a type`| +-------------------------------------------------------------------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------------------------------------------+-----------------------+----------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`attribute` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is ignored, place it after "`|+---------------------+|:diagtext:`" to apply attribute to type declaration`| | ||:diagtext:`class` || | | |+---------------------+| | | ||:diagtext:`struct` || | | |+---------------------+| | | ||:diagtext:`interface`|| | | |+---------------------+| | | ||:diagtext:`union` || | | |+---------------------+| | | ||:diagtext:`enum` || | | |+---------------------+| | +------------------------------------------------------------------------------------------------------------------------+-----------------------+----------------------------------------------------+ +--------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'deprecated' attribute on anonymous namespace ignored`| +--------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`redeclared inline;` |nbsp| :placeholder:`B` |nbsp| :diagtext:`attribute ignored`| +----------------------------------------------------------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`attribute` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is already applied with different parameters`| +----------------------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`attribute` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is already applied`| +--------------------------------------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`Objective-C GC does not allow weak variables on the stack`| +------------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'gnu\_inline' attribute requires function to be marked 'inline', attribute ignored`| +-------------------------------------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------+------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`inheritance model ignored on` |nbsp| |+----------------------------------+| | ||:diagtext:`primary template` || | |+----------------------------------+| | ||:diagtext:`partial specialization`|| | |+----------------------------------+| +---------------------------------------------------------------------------+------------------------------------+ +--------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'internal\_linkage' attribute on a non-static local variable is ignored`| +--------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`qualifiers after comma in declarator list are ignored`| +--------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------------------+----------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`MIPS 'interrupt' attribute only applies to functions that have` |nbsp| |+--------------------------------+| | ||:diagtext:`no parameters` || | |+--------------------------------+| | ||:diagtext:`a 'void' return type`|| | |+--------------------------------+| +-------------------------------------------------------------------------------------------------------------+----------------------------------+ +---------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`unknown attribute '`:placeholder:`A`:diagtext:`'`| +---------------------------------------------------------------------------------------+ ++-------------------------------------------------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`'nocf\_check' attribute ignored; use -fcf-protection to enable the attribute`| ++-------------------------------------------------------------------------------------------------------------------+ + +------------------------------------------------------------------------------------------------+-----------------------------------+------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`attribute only applies to` |nbsp| |+---------------------------------+| |nbsp| :diagtext:`parameters`| | ||:diagtext:`Objective-C object` || | | |+---------------------------------+| | | ||:diagtext:`pointer` || | | |+---------------------------------+| | | ||:diagtext:`pointer-to-CF-pointer`|| | | |+---------------------------------+| | +------------------------------------------------------------------------------------------------+-----------------------------------+------------------------------+ +------------------------------------------------------------------------------------------------+------------------------+---------------------------------------+--------------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`attribute only applies to` |nbsp| |+----------------------+| |nbsp| :diagtext:`that return` |nbsp| |+------------------------------------+| | ||:diagtext:`functions` || ||:diagtext:`an Objective-C object` || | |+----------------------+| |+------------------------------------+| | ||:diagtext:`methods` || ||:diagtext:`a pointer` || | |+----------------------+| |+------------------------------------+| | ||:diagtext:`properties`|| ||:diagtext:`a non-retainable pointer`|| | |+----------------------+| |+------------------------------------+| +------------------------------------------------------------------------------------------------+------------------------+---------------------------------------+--------------------------------------+ +--------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`attribute is deprecated and ignored in OpenCL version` |nbsp| :placeholder:`B`| +--------------------------------------------------------------------------------------------------------------------------------------------+ ++---------------------------------------------------------------------------------------------------------------+----------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`RISC-V 'interrupt' attribute only applies to functions that have` |nbsp| |+--------------------------------+| +| ||:diagtext:`no parameters` || +| |+--------------------------------+| +| ||:diagtext:`a 'void' return type`|| +| |+--------------------------------+| ++---------------------------------------------------------------------------------------------------------------+----------------------------------+ + ++----------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`repeated RISC-V 'interrupt' attribute`| ++----------------------------------------------------------------------------+ + +---------------------------+-----------------------+---------------------------------------------------------------------------------------------------------------------------------------------+-----------------------+-------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| |+---------------------+| |nbsp| :diagtext:`of field` |nbsp| :placeholder:`B` |nbsp| :diagtext:`(`:placeholder:`C` |nbsp| :diagtext:`bits) does not match the` |nbsp| |+---------------------+| |nbsp| :diagtext:`of the first field in transparent union; transparent\_union attribute ignored`| | ||:diagtext:`alignment`|| ||:diagtext:`alignment`|| | | |+---------------------+| |+---------------------+| | | ||:diagtext:`size` || ||:diagtext:`size` || | | |+---------------------+| |+---------------------+| | +---------------------------+-----------------------+---------------------------------------------------------------------------------------------------------------------------------------------+-----------------------+-------------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------+----------------------------+--------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`first field of a transparent union cannot have` |nbsp| |+--------------------------+| |nbsp| :diagtext:`type` |nbsp| :placeholder:`B`:diagtext:`; transparent\_union attribute ignored`| | ||:diagtext:`floating point`|| | | |+--------------------------+| | | ||:diagtext:`vector` || | | |+--------------------------+| | +---------------------------------------------------------------------------------------------+----------------------------+--------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`transparent\_union attribute can only be applied to a union definition; attribute ignored`| +--------------------------------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`transparent union definition must contain at least one field; transparent\_union attribute ignored`| +-----------------------------------------------------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------+-------------------------------------------------+---------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'`:placeholder:`A`:diagtext:`' only applies to` |nbsp| |+-----------------------------------------------+| |nbsp| :diagtext:`types; type here is` |nbsp| :placeholder:`C`| | ||:diagtext:`function` || | | |+-----------------------------------------------+| | | ||:diagtext:`pointer` || | | |+-----------------------------------------------+| | | ||:diagtext:`Objective-C object or block pointer`|| | | |+-----------------------------------------------+| | +---------------------------------------------------------------------------------------------+-------------------------------------------------+---------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`\_\_declspec attribute` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is not supported`| +-------------------------------------------------------------------------------------------------------------------------+ -+-------------------------------------------------------+-------------------------+----------------------------------+---------------------------------------------------------------------------------+ -|:warning:`warning:` |nbsp| :diagtext:`ignoring` |nbsp| |+-----------------------+|+--------------------------------+| |nbsp| :diagtext:`'`:placeholder:`C`:diagtext:`' in the target attribute string`| -| ||:diagtext:`unsupported`||| || | -| |+-----------------------+|+--------------------------------+| | -| ||:diagtext:`duplicate` ||| |nbsp| :diagtext:`architecture`|| | -| |+-----------------------+|+--------------------------------+| | -+-------------------------------------------------------+-------------------------+----------------------------------+---------------------------------------------------------------------------------+ ++---------------------------+-------------------------+----------------------------------+---------------------------------------------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| |+-----------------------+|+--------------------------------+| |nbsp| :diagtext:`'`:placeholder:`C`:diagtext:`' in the 'target' attribute string; 'target' attribute ignored`| +| ||:diagtext:`unsupported`||| || | +| |+-----------------------+|+--------------------------------+| | +| ||:diagtext:`duplicate` ||| |nbsp| :diagtext:`architecture`|| | +| |+-----------------------+|+--------------------------------+| | ++---------------------------+-------------------------+----------------------------------+---------------------------------------------------------------------------------------------------------------+ -Wignored-optimization-argument ------------------------------- This diagnostic is enabled by default. **Diagnostic text:** +--------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`optimization flag '`:placeholder:`A`:diagtext:`' is not supported for target '`:placeholder:`B`:diagtext:`'`| +--------------------------------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`optimization flag '`:placeholder:`A`:diagtext:`' is not supported`| +--------------------------------------------------------------------------------------------------------+ -Wignored-pragma-intrinsic -------------------------- This diagnostic is enabled by default. **Diagnostic text:** +------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is not a recognized builtin`|+----------------------------------------------------------------------------+| | || || | |+----------------------------------------------------------------------------+| | ||:diagtext:`; consider including to access non-builtin intrinsics`|| | |+----------------------------------------------------------------------------+| +------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+ +-Wignored-pragma-optimize +------------------------- +This diagnostic is enabled by default. + +**Diagnostic text:** + ++--------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`'#pragma optimize' is not supported`| ++--------------------------------------------------------------------------+ + + -Wignored-pragmas ----------------- This diagnostic is enabled by default. -Also controls `-Wignored-pragma-intrinsic`_. +Also controls `-Wignored-pragma-intrinsic`_, `-Wignored-pragma-optimize`_. **Diagnostic text:** +------------------------------------------------------------------------------+---------------------------+-----------------------+ |:warning:`warning:` |nbsp| :diagtext:`expected '=' following '#pragma` |nbsp| |+-------------------------+|:diagtext:`' - ignored`| | ||:diagtext:`align` || | | |+-------------------------+| | | ||:diagtext:`options align`|| | | |+-------------------------+| | +------------------------------------------------------------------------------+---------------------------+-----------------------+ +-----------------------------------------------------------------------------------+---------------------------+-----------------------+ |:warning:`warning:` |nbsp| :diagtext:`invalid alignment option in '#pragma` |nbsp| |+-------------------------+|:diagtext:`' - ignored`| | ||:diagtext:`align` || | | |+-------------------------+| | | ||:diagtext:`options align`|| | | |+-------------------------+| | +-----------------------------------------------------------------------------------+---------------------------+-----------------------+ +-----------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`OpenCL extension end directive mismatches begin directive - ignoring`| +-----------------------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'#pragma comment` |nbsp| :placeholder:`A`:diagtext:`' ignored`| +----------------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`missing argument to debug command '`:placeholder:`A`:diagtext:`'`| +-------------------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`unexpected debug command '`:placeholder:`A`:diagtext:`'`| +----------------------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`expected action or ')' in '#pragma` |nbsp| :placeholder:`A`:diagtext:`' - ignored`| +------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`missing ':' after` |nbsp| :placeholder:`A` |nbsp| :diagtext:`- ignoring`| +--------------------------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`missing ':' or ')' after` |nbsp| :placeholder:`A` |nbsp| :diagtext:`- ignoring`| +---------------------------------------------------------------------------------------------------------------------+ ++----------------------------------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`expected ',' in '#pragma` |nbsp| :placeholder:`A`:diagtext:`'`| ++----------------------------------------------------------------------------------------------------+ + +---------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`expected identifier in '#pragma` |nbsp| :placeholder:`A`:diagtext:`' - ignored`| +---------------------------------------------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`expected 'compiler', 'lib', 'user', or a string literal for the section name in '#pragma` |nbsp| :placeholder:`A`:diagtext:`' - ignored`| +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`expected integer between` |nbsp| :placeholder:`A` |nbsp| :diagtext:`and` |nbsp| :placeholder:`B` |nbsp| :diagtext:`inclusive in '#pragma` |nbsp| :placeholder:`C`:diagtext:`' - ignored`| +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`missing '(' after '#pragma` |nbsp| :placeholder:`A`:diagtext:`' - ignoring`| +-----------------------------------------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`expected non-wide string literal in '#pragma` |nbsp| :placeholder:`A`:diagtext:`'`| +------------------------------------------------------------------------------------------------------------------------+ +-------------------------------------------------------+---------------------------------------------------+------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`expected` |nbsp| |+-------------------------------------------------+| |nbsp| :diagtext:`- ignoring`| | ||:diagtext:`'enable', 'disable', 'begin' or 'end'`|| | | |+-------------------------------------------------+| | | ||:diagtext:`'disable'` || | | |+-------------------------------------------------+| | +-------------------------------------------------------+---------------------------------------------------+------------------------------+ +-----------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`expected ')' or ',' in '#pragma` |nbsp| :placeholder:`A`:diagtext:`'`| +-----------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`missing ')' after '#pragma` |nbsp| :placeholder:`A`:diagtext:`' - ignoring`| +-----------------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`expected a stack label or a string literal for the section name in '#pragma` |nbsp| :placeholder:`A`:diagtext:`' - ignored`| +-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`expected a string literal for the section name in '#pragma` |nbsp| :placeholder:`A`:diagtext:`' - ignored`| +------------------------------------------------------------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`expected push, pop or a string literal for the section name in '#pragma` |nbsp| :placeholder:`A`:diagtext:`' - ignored`| +-------------------------------------------------------------------------------------------------------------------------------------------------------------+ ++--------------------------------------------------------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`expected string literal in '#pragma` |nbsp| :placeholder:`A`:diagtext:`' - ignoring`| ++--------------------------------------------------------------------------------------------------------------------------+ + +---------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`extra tokens at end of '#pragma` |nbsp| :placeholder:`A`:diagtext:`' - ignored`| +---------------------------------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`incorrect use of #pragma clang force\_cuda\_host\_device begin\|end`| +----------------------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'#pragma init\_seg' is only supported when targeting a Microsoft environment`| +-------------------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`unknown action for '#pragma` |nbsp| :placeholder:`A`:diagtext:`' - ignored`| +-----------------------------------------------------------------------------------------------------------------+ ++------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`unexpected argument '`:placeholder:`A`:diagtext:`' to '#pragma` |nbsp| :placeholder:`B`:diagtext:`'`|+------------------------------------------------+| +| || || +| |+------------------------------------------------+| +| ||+----------------------------------------------+|| +| |||:diagtext:`; expected` |nbsp| :placeholder:`D`||| +| ||+----------------------------------------------+|| +| |+------------------------------------------------+| ++------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------+ + +------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`unknown action '`:placeholder:`B`:diagtext:`' for '#pragma` |nbsp| :placeholder:`A`:diagtext:`' - ignored`| +------------------------------------------------------------------------------------------------------------------------------------------------+ ++--------------------------------------------------------------------------------------------------------+--------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`missing argument to '#pragma` |nbsp| :placeholder:`A`:diagtext:`'`|+------------------------------------------------+| +| || || +| |+------------------------------------------------+| +| ||+----------------------------------------------+|| +| |||:diagtext:`; expected` |nbsp| :placeholder:`C`||| +| ||+----------------------------------------------+|| +| |+------------------------------------------------+| ++--------------------------------------------------------------------------------------------------------+--------------------------------------------------+ + +----------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`incorrect use of '#pragma ms\_struct on\|off' - ignored`| +----------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`#pragma options align=reset failed:` |nbsp| :placeholder:`A`| +--------------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`expected 'align' following '#pragma options' - ignored`| +---------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`expected #pragma pack parameter to be '1', '2', '4', '8', or '16'`| +--------------------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`expected integer or identifier in '#pragma pack' - ignored`| +-------------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`#pragma` |nbsp| :placeholder:`A`:diagtext:`(pop, ...) failed:` |nbsp| :placeholder:`B`| +----------------------------------------------------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`pragma pop\_macro could not pop '`:placeholder:`A`:diagtext:`', no matching push\_macro`| +------------------------------------------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`unknown OpenCL extension` |nbsp| :placeholder:`A` |nbsp| :diagtext:`- ignoring`| +---------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`known but unsupported action '`:placeholder:`B`:diagtext:`' for '#pragma` |nbsp| :placeholder:`A`:diagtext:`' - ignored`| +--------------------------------------------------------------------------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`unsupported OpenCL extension` |nbsp| :placeholder:`A` |nbsp| :diagtext:`- ignoring`| +-------------------------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`expected '#pragma unused' argument to be a variable name`| +-----------------------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`only variables can be arguments to '#pragma unused'`| +------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`undeclared variable` |nbsp| :placeholder:`A` |nbsp| :diagtext:`used as an argument for '#pragma unused'`| +----------------------------------------------------------------------------------------------------------------------------------------------+ -Wignored-qualifiers -------------------- Some of the diagnostics controlled by this flag are enabled by default. **Diagnostic text:** +--------------------------------------------------+------------------------------------+----------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`ARC` |nbsp| |+----------------------------------+| |nbsp| :diagtext:`lifetime qualifier on return type is ignored`| | ||:diagtext:`unused` || | | |+----------------------------------+| | | ||:diagtext:`\_\_unsafe\_unretained`|| | | |+----------------------------------+| | | ||:diagtext:`\_\_strong` || | | |+----------------------------------+| | | ||:diagtext:`\_\_weak` || | | |+----------------------------------+| | | ||:diagtext:`\_\_autoreleasing` || | | |+----------------------------------+| | +--------------------------------------------------+------------------------------------+----------------------------------------------------------------+ +---------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'`:placeholder:`A`:diagtext:`' qualifier on omitted return type` |nbsp| :placeholder:`B` |nbsp| :diagtext:`has no effect`| +---------------------------------------------------------------------------------------------------------------------------------------------------------------+ -+------------------------------------------------------------------------------------+---------------+------------------------------------------+-------------------+-----------------------------+ -|:warning:`warning:` |nbsp| :diagtext:`'`:placeholder:`A`:diagtext:`' type qualifier`|+-------------+| |nbsp| :diagtext:`on return type` |nbsp| |+-----------------+| |nbsp| :diagtext:`no effect`| -| || || ||:diagtext:`:has` || | -| |+-------------+| |+-----------------+| | -| ||:diagtext:`s`|| ||:diagtext:`:have`|| | -| |+-------------+| |+-----------------+| | -+------------------------------------------------------------------------------------+---------------+------------------------------------------+-------------------+-----------------------------+ ++------------------------------------------------------------------------------------+---------------+------------------------------------------+------------------+-----------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`'`:placeholder:`A`:diagtext:`' type qualifier`|+-------------+| |nbsp| :diagtext:`on return type` |nbsp| |+----------------+| |nbsp| :diagtext:`no effect`| +| || || ||:diagtext:`has` || | +| |+-------------+| |+----------------+| | +| ||:diagtext:`s`|| ||:diagtext:`have`|| | +| |+-------------+| |+----------------+| | ++------------------------------------------------------------------------------------+---------------+------------------------------------------+------------------+-----------------------------+ +---------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'`:placeholder:`A`:diagtext:`' qualifier on function type` |nbsp| :placeholder:`B` |nbsp| :diagtext:`has no effect`| +---------------------------------------------------------------------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'`:placeholder:`A`:diagtext:`' qualifier on reference type` |nbsp| :placeholder:`B` |nbsp| :diagtext:`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:`warning:` |nbsp| :diagtext:`property is assumed atomic when auto-synthesizing the property`| +-----------------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`property is assumed atomic by default`| +----------------------------------------------------------------------------+ -Wimplicit-conversion-floating-point-to-bool -------------------------------------------- This diagnostic is enabled by default. **Diagnostic text:** +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`implicit conversion turns floating-point number into bool:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`to` |nbsp| :placeholder:`B`| +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wimplicit-exception-spec-mismatch ---------------------------------- This diagnostic is enabled by default. **Diagnostic text:** +-----------------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------+----------------------+-------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`function previously declared with an` |nbsp| |+--------------------+| |nbsp| :diagtext:`exception specification redeclared with an` |nbsp| |+--------------------+| |nbsp| :diagtext:`exception specification`| | ||:diagtext:`explicit`|| ||:diagtext:`implicit`|| | | |+--------------------+| |+--------------------+| | | ||:diagtext:`implicit`|| ||:diagtext:`explicit`|| | | |+--------------------+| |+--------------------+| | +-----------------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------+----------------------+-------------------------------------------+ -Wimplicit-fallthrough ---------------------- Also controls `-Wimplicit-fallthrough-per-function`_. **Diagnostic text:** +---------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`fallthrough annotation in unreachable code`| +---------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`unannotated fall-through between switch labels`| +-------------------------------------------------------------------------------------+ -Wimplicit-fallthrough-per-function ----------------------------------- **Diagnostic text:** +------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`unannotated fall-through between switch labels in partly-annotated function`| +------------------------------------------------------------------------------------------------------------------+ -Wimplicit-function-declaration ------------------------------- Some of the diagnostics controlled by this flag are enabled by default. **Diagnostic text:** +----------------------------------------------------------------------------------------------------------------------------------------+--------------------+ |:warning:`warning:` |nbsp| :diagtext:`implicit declaration of function` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is invalid in` |nbsp| |+------------------+| | ||:diagtext:`C99` || | |+------------------+| | ||:diagtext:`OpenCL`|| | |+------------------+| +----------------------------------------------------------------------------------------------------------------------------------------+--------------------+ +---------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`implicitly declaring library function '`:placeholder:`A`:diagtext:`' with type` |nbsp| :placeholder:`B`| +---------------------------------------------------------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------+ |:error:`error:` |nbsp| :diagtext:`use of unknown builtin` |nbsp| :placeholder:`A`| +---------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`implicit declaration of function` |nbsp| :placeholder:`A`| +-----------------------------------------------------------------------------------------------+ -Wimplicit-int -------------- This diagnostic is enabled by default. **Diagnostic text:** +--------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`type specifier missing, defaults to 'int'`| +--------------------------------------------------------------------------------+ -Wimplicit-retain-self ---------------------- **Diagnostic text:** +---------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`block implicitly retains 'self'; explicitly mention 'self' to indicate this is intended behavior`| +---------------------------------------------------------------------------------------------------------------------------------------+ -Wimplicitly-unsigned-literal ----------------------------- This diagnostic is enabled by default. **Diagnostic text:** +----------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`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-preprocessor-directive-pedantic ---------------------------------------- **Diagnostic text:** +----------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`#import is a language extension`| +----------------------------------------------------------------------+ -Winaccessible-base ------------------- This diagnostic is enabled by default. **Diagnostic text:** +-----------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`direct base` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is inaccessible due to ambiguity:`:placeholder:`B`| +-----------------------------------------------------------------------------------------------------------------------------------------------+ -Winclude-next-absolute-path ---------------------------- This diagnostic is enabled by default. **Diagnostic text:** +------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`#include\_next with absolute path`| +------------------------------------------------------------------------+ -Winclude-next-outside-header ----------------------------- This diagnostic is enabled by default. **Diagnostic text:** +----------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`#include\_next in primary source file`| +----------------------------------------------------------------------------+ -Wincompatible-exception-spec ----------------------------- This diagnostic is enabled by default. **Diagnostic text:** +--------------------------------------------------------------------------+----------------------+--------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`exception specifications of` |nbsp| |+--------------------+| |nbsp| :diagtext:`types differ`| | ||:diagtext:`return` || | | |+--------------------+| | | ||:diagtext:`argument`|| | | |+--------------------+| | +--------------------------------------------------------------------------+----------------------+--------------------------------+ +-----------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`target exception specification is not superset of source`| +-----------------------------------------------------------------------------------------------+ -Wincompatible-function-pointer-types ------------------------------------- This diagnostic is enabled by default. **Diagnostic text:** +----------------------------------------------------------------------------------+----------------------------------------------------------------+---------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`incompatible function pointer types` |nbsp| |+--------------------------------------------------------------+|+-------------------------------------+| | ||:diagtext:`assigning to different types` ||| || | |+--------------------------------------------------------------+|+-------------------------------------+| | ||:diagtext:`passing to parameter of different type` |||:diagtext:`; dereference with \*` || | |+--------------------------------------------------------------+|+-------------------------------------+| | ||:diagtext:`returning from function with different return type`|||:diagtext:`; take the address with &`|| | |+--------------------------------------------------------------+|+-------------------------------------+| | ||:diagtext:`converting between types` |||:diagtext:`; remove \*` || | |+--------------------------------------------------------------+|+-------------------------------------+| | ||:diagtext:`initializing with expression of different type` |||:diagtext:`; remove &` || | |+--------------------------------------------------------------+|+-------------------------------------+| | ||:diagtext:`sending to parameter of different type` || | | |+--------------------------------------------------------------+| | | ||:diagtext:`casting between types` || | | |+--------------------------------------------------------------+| | +----------------------------------------------------------------------------------+----------------------------------------------------------------+---------------------------------------+ -Wincompatible-library-redeclaration ------------------------------------ This diagnostic is enabled by default. **Diagnostic text:** +-------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`incompatible redeclaration of library function` |nbsp| :placeholder:`A`| +-------------------------------------------------------------------------------------------------------------+ -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:`error:` |nbsp| :diagtext:`ms\_struct may not produce Microsoft-compatible layouts for classes with base classes or virtual functions`| +---------------------------------------------------------------------------------------------------------------------------------------------+ ++------------------------------------------------------------------------------------------------------------------------------------------------------------+ +|:error:`error:` |nbsp| :diagtext:`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-qualifiers`_. **Diagnostic text:** +-------------------------------------------------------------------------+----------------------------------------------------------------+---------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`incompatible pointer types` |nbsp| |+--------------------------------------------------------------+|+-------------------------------------+| | ||:diagtext:`assigning to different types` ||| || | |+--------------------------------------------------------------+|+-------------------------------------+| | ||:diagtext:`passing to parameter of different type` |||:diagtext:`; dereference with \*` || | |+--------------------------------------------------------------+|+-------------------------------------+| | ||:diagtext:`returning from function with different return type`|||:diagtext:`; take the address with &`|| | |+--------------------------------------------------------------+|+-------------------------------------+| | ||:diagtext:`converting between types` |||:diagtext:`; remove \*` || | |+--------------------------------------------------------------+|+-------------------------------------+| | ||:diagtext:`initializing with expression of different type` |||:diagtext:`; remove &` || | |+--------------------------------------------------------------+|+-------------------------------------+| | ||:diagtext:`sending to parameter of different type` || | | |+--------------------------------------------------------------+| | | ||:diagtext:`casting between types` || | | |+--------------------------------------------------------------+| | +-------------------------------------------------------------------------+----------------------------------------------------------------+---------------------------------------+ -Wincompatible-pointer-types-discards-qualifiers ------------------------------------------------ This diagnostic is enabled by default. **Diagnostic text:** +---------------------------+----------------------------------------------------------------+---------------------------------------------------------------+ |:warning:`warning:` |nbsp| |+--------------------------------------------------------------+| |nbsp| :diagtext:`discards qualifiers in nested pointer types`| | ||:diagtext:`assigning to different types` || | | |+--------------------------------------------------------------+| | | ||:diagtext:`passing to parameter of different type` || | | |+--------------------------------------------------------------+| | | ||:diagtext:`returning from function with different return type`|| | | |+--------------------------------------------------------------+| | | ||:diagtext:`converting between types` || | | |+--------------------------------------------------------------+| | | ||:diagtext:`initializing with expression of different type` || | | |+--------------------------------------------------------------+| | | ||:diagtext:`sending to parameter of different type` || | | |+--------------------------------------------------------------+| | | ||:diagtext:`casting between types` || | | |+--------------------------------------------------------------+| | +---------------------------+----------------------------------------------------------------+---------------------------------------------------------------+ +---------------------------+----------------------------------------------------------------+---------------------------------------+ |:warning:`warning:` |nbsp| |+--------------------------------------------------------------+| |nbsp| :diagtext:`discards qualifiers`| | ||:diagtext:`assigning to different types` || | | |+--------------------------------------------------------------+| | | ||:diagtext:`passing to parameter of different type` || | | |+--------------------------------------------------------------+| | | ||:diagtext:`returning from function with different return type`|| | | |+--------------------------------------------------------------+| | | ||:diagtext:`converting between types` || | | |+--------------------------------------------------------------+| | | ||:diagtext:`initializing with expression of different type` || | | |+--------------------------------------------------------------+| | | ||:diagtext:`sending to parameter of different type` || | | |+--------------------------------------------------------------+| | | ||:diagtext:`casting between types` || | | |+--------------------------------------------------------------+| | +---------------------------+----------------------------------------------------------------+---------------------------------------+ -Wincompatible-property-type ---------------------------- This diagnostic is enabled by default. **Diagnostic text:** +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`property type` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is incompatible with type` |nbsp| :placeholder:`B` |nbsp| :diagtext:`inherited from` |nbsp| :placeholder:`C`| +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wincompatible-sysroot ---------------------- This diagnostic is enabled by default. **Diagnostic text:** +------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`using sysroot for '`:placeholder:`A`:diagtext:`' but targeting '`:placeholder:`B`:diagtext:`'`| +------------------------------------------------------------------------------------------------------------------------------------+ +-Wincomplete-framework-module-declaration +----------------------------------------- +This diagnostic is enabled by default. + +**Diagnostic text:** + ++---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`skipping '`:placeholder:`A`:diagtext:`' because module declaration of '`:placeholder:`B`:diagtext:`' lacks the 'framework' qualifier`| ++---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + + -Wincomplete-implementation --------------------------- This diagnostic is enabled by default. **Diagnostic text:** +-----------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`method definition for` |nbsp| :placeholder:`A` |nbsp| :diagtext:`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-umbrella --------------------- This diagnostic is enabled by default. **Diagnostic text:** +---------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`missing submodule '`:placeholder:`A`:diagtext:`'`| +---------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`umbrella directory '`:placeholder:`A`:diagtext:`' not found`| +--------------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`umbrella header for module '`:placeholder:`A`:diagtext:`' does not include header '`:placeholder:`B`:diagtext:`'`| +-------------------------------------------------------------------------------------------------------------------------------------------------------+ -Winconsistent-dllimport ------------------------ This diagnostic is enabled by default. **Diagnostic text:** +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`redeclared without` |nbsp| :placeholder:`B` |nbsp| :diagtext:`attribute: previous` |nbsp| :placeholder:`B` |nbsp| :diagtext:`ignored`| +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`redeclared without 'dllimport' attribute: 'dllexport' attribute added`| +------------------------------------------------------------------------------------------------------------------------------------+ -Winconsistent-missing-destructor-override ------------------------------------------ **Diagnostic text:** +------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`overrides a destructor but is not marked 'override'`| +------------------------------------------------------------------------------------------------------------------+ -Winconsistent-missing-override ------------------------------- This diagnostic is enabled by default. **Diagnostic text:** +-----------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`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:`error:` |nbsp| :diagtext:`ISO C++17 does not allow incrementing expression of type bool`| +------------------------------------------------------------------------------------------------+ -Winfinite-recursion -------------------- **Diagnostic text:** +---------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`all paths through this function will call itself`| +---------------------------------------------------------------------------------------+ -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:`warning:` |nbsp| :diagtext:`initializer overrides prior initialization of this subobject`| +---------------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`subobject initialization overrides initialization of other fields within its enclosing subobject`| +---------------------------------------------------------------------------------------------------------------------------------------+ -Winjected-class-name --------------------- This diagnostic is enabled by default. **Diagnostic text:** +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------+--------------------------------------------------------------+------------------------+---------------------------+ |:warning:`warning:` |nbsp| :diagtext:`ISO C++ specifies that qualified reference to` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is a constructor name rather than a` |nbsp| |+-------------------------+| |nbsp| :diagtext:`in this context, despite preceding` |nbsp| |+----------------------+| |nbsp| :diagtext:`keyword`| | ||:diagtext:`template name`|| ||:diagtext:`'typename'`|| | | |+-------------------------+| |+----------------------+| | | ||:diagtext:`type` || ||:diagtext:`'template'`|| | | |+-------------------------+| |+----------------------+| | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------+--------------------------------------------------------------+------------------------+---------------------------+ -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-new-delete ------------------- This diagnostic is enabled by default. **Diagnostic text:** +----------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`replacement function` |nbsp| :placeholder:`A` |nbsp| :diagtext:`cannot be declared 'inline'`| +----------------------------------------------------------------------------------------------------------------------------------+ -Winstantiation-after-specialization ------------------------------------ This diagnostic is enabled by default. **Diagnostic text:** +----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`explicit instantiation of` |nbsp| :placeholder:`A` |nbsp| :diagtext:`that occurs after an explicit specialization has no effect`| +----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wint-conversion ---------------- This diagnostic is enabled by default. **Diagnostic text:** +-----------------------------------------------------------------------------------------+----------------------------------------------------------------+---------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`incompatible integer to pointer conversion` |nbsp| |+--------------------------------------------------------------+|+-------------------------------------+| | ||:diagtext:`assigning to different types` ||| || | |+--------------------------------------------------------------+|+-------------------------------------+| | ||:diagtext:`passing to parameter of different type` |||:diagtext:`; dereference with \*` || | |+--------------------------------------------------------------+|+-------------------------------------+| | ||:diagtext:`returning from function with different return type`|||:diagtext:`; take the address with &`|| | |+--------------------------------------------------------------+|+-------------------------------------+| | ||:diagtext:`converting between types` |||:diagtext:`; remove \*` || | |+--------------------------------------------------------------+|+-------------------------------------+| | ||:diagtext:`initializing with expression of different type` |||:diagtext:`; remove &` || | |+--------------------------------------------------------------+|+-------------------------------------+| | ||:diagtext:`sending to parameter of different type` || | | |+--------------------------------------------------------------+| | | ||:diagtext:`casting between types` || | | |+--------------------------------------------------------------+| | +-----------------------------------------------------------------------------------------+----------------------------------------------------------------+---------------------------------------+ +-----------------------------------------------------------------------------------------+----------------------------------------------------------------+---------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`incompatible pointer to integer conversion` |nbsp| |+--------------------------------------------------------------+|+-------------------------------------+| | ||:diagtext:`assigning to different types` ||| || | |+--------------------------------------------------------------+|+-------------------------------------+| | ||:diagtext:`passing to parameter of different type` |||:diagtext:`; dereference with \*` || | |+--------------------------------------------------------------+|+-------------------------------------+| | ||:diagtext:`returning from function with different return type`|||:diagtext:`; take the address with &`|| | |+--------------------------------------------------------------+|+-------------------------------------+| | ||:diagtext:`converting between types` |||:diagtext:`; remove \*` || | |+--------------------------------------------------------------+|+-------------------------------------+| | ||:diagtext:`initializing with expression of different type` |||:diagtext:`; remove &` || | |+--------------------------------------------------------------+|+-------------------------------------+| | ||:diagtext:`sending to parameter of different type` || | | |+--------------------------------------------------------------+| | | ||:diagtext:`casting between types` || | | |+--------------------------------------------------------------+| | +-----------------------------------------------------------------------------------------+----------------------------------------------------------------+---------------------------------------+ -Wint-conversions ----------------- Synonym for `-Wint-conversion`_. -Wint-to-pointer-cast --------------------- This diagnostic is enabled by default. Also controls `-Wint-to-void-pointer-cast`_. **Diagnostic text:** +-------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`cast to` |nbsp| :placeholder:`B` |nbsp| :diagtext:`from smaller integer type` |nbsp| :placeholder:`A`| +-------------------------------------------------------------------------------------------------------------------------------------------+ -Wint-to-void-pointer-cast -------------------------- This diagnostic is enabled by default. **Diagnostic text:** +-------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`cast to` |nbsp| :placeholder:`B` |nbsp| :diagtext:`from smaller integer type` |nbsp| :placeholder:`A`| +-------------------------------------------------------------------------------------------------------------------------------------------+ -Winteger-overflow ------------------ This diagnostic is enabled by default. **Diagnostic text:** +-----------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`overflow in expression; result is` |nbsp| :placeholder:`A` |nbsp| :diagtext:`with type` |nbsp| :placeholder:`B`| +-----------------------------------------------------------------------------------------------------------------------------------------------------+ -Winvalid-command-line-argument ------------------------------- This diagnostic is enabled by default. Also controls `-Wignored-optimization-argument`_. **Diagnostic text:** +-----------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`the object size sanitizer has no effect at -O0, but is explicitly enabled:` |nbsp| :placeholder:`A`| +-----------------------------------------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`optimization level '`:placeholder:`A`:diagtext:`' is not supported; using '`:placeholder:`B`:placeholder:`C`:diagtext:`' instead`| +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Winvalid-constexpr ------------------- This diagnostic is an error by default, but the flag ``-Wno-invalid-constexpr`` can be used to disable the error. **Diagnostic text:** +----------------------------------------------------+-------------------------+--------------------------------------------------------+ |:error:`error:` |nbsp| :diagtext:`constexpr` |nbsp| |+-----------------------+| |nbsp| :diagtext:`never produces a constant expression`| | ||:diagtext:`function` || | | |+-----------------------+| | | ||:diagtext:`constructor`|| | | |+-----------------------+| | +----------------------------------------------------+-------------------------+--------------------------------------------------------+ -Winvalid-iboutlet ------------------ This diagnostic is enabled by default. **Diagnostic text:** +---------------------------+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| |+-----------------------------+| |nbsp| :diagtext:`with` |nbsp| :placeholder:`A` |nbsp| :diagtext:`attribute must be an object type (invalid` |nbsp| :placeholder:`B`:diagtext:`)`| | ||:diagtext:`instance variable`|| | | |+-----------------------------+| | | ||:diagtext:`property` || | | |+-----------------------------+| | +---------------------------+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`IBOutletCollection properties should be copy/strong and not assign`| +---------------------------------------------------------------------------------------------------------+ -Winvalid-initializer-from-system-header ---------------------------------------- This diagnostic is enabled by default. **Diagnostic text:** +--------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`invalid constructor form class in system header, should not be explicit`| +--------------------------------------------------------------------------------------------------------------+ -Winvalid-ios-deployment-target ------------------------------- This diagnostic is an error by default, but the flag ``-Wno-invalid-ios-deployment-target`` can be used to disable the error. **Diagnostic text:** +------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:error:`error:` |nbsp| :diagtext:`invalid iOS deployment version '`:placeholder:`A`:diagtext:`', iOS 10 is the maximum deployment target for 32-bit targets`| +------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Winvalid-noreturn ------------------ This diagnostic is enabled by default. **Diagnostic text:** +-------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`function declared 'noreturn' should not return`| +-------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`function` |nbsp| :placeholder:`A` |nbsp| :diagtext:`declared 'noreturn' should not return`| +--------------------------------------------------------------------------------------------------------------------------------+ -Winvalid-offsetof ------------------ This diagnostic is enabled by default. **Diagnostic text:** +----------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`offset of on non-POD type` |nbsp| :placeholder:`A`| +----------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`offset of on non-standard-layout type` |nbsp| :placeholder:`A`| +----------------------------------------------------------------------------------------------------+ -Winvalid-or-nonexistent-directory ---------------------------------- Some of the diagnostics controlled by this flag are enabled by default. **Diagnostic text:** +----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`environment variable SCE\_ORBIS\_SDK\_DIR is set, but points to invalid or nonexistent directory '`:placeholder:`A`:diagtext:`'`| +----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`unable to find` |nbsp| :placeholder:`A` |nbsp| :diagtext:`directory, expected to be in '`:placeholder:`B`:diagtext:`'`| +------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Winvalid-partial-specialization -------------------------------- This diagnostic is an error by default, but the flag ``-Wno-invalid-partial-specialization`` can be used to disable the error. **Diagnostic text:** +-----------------------+----------------------+-----------------------------------------------------------------------------------------------------+ |:error:`error:` |nbsp| |+--------------------+| |nbsp| :diagtext:`template partial specialization is not more specialized than the primary template`| | ||:diagtext:`class` || | | |+--------------------+| | | ||:diagtext:`variable`|| | | |+--------------------+| | +-----------------------+----------------------+-----------------------------------------------------------------------------------------------------+ -Winvalid-pch ------------- This diagnostic flag exists for GCC compatibility, and has no effect in Clang. -Winvalid-pp-token ------------------ This diagnostic is enabled by default. **Diagnostic text:** +---------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`empty character constant`| +---------------------------------------------------------------+ +------------------------------------------------------------------+-----------------+-----------------------------+ |:warning:`warning:` |nbsp| :diagtext:`missing terminating` |nbsp| |+---------------+| |nbsp| :diagtext:`character`| | ||:diagtext:`'` || | | |+---------------+| | | ||:diagtext:`'"'`|| | | |+---------------+| | +------------------------------------------------------------------+-----------------+-----------------------------+ -Winvalid-source-encoding ------------------------- This diagnostic is enabled by default. **Diagnostic text:** +--------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`illegal character encoding in character literal`| +--------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`illegal character encoding in string literal`| +-----------------------------------------------------------------------------------+ -Winvalid-token-paste --------------------- This diagnostic is an error by default, but the flag ``-Wno-invalid-token-paste`` can be used to disable the error. **Diagnostic text:** +----------------------------------------------------------------------------------------------------------------+ |:error:`error:` |nbsp| :diagtext:`pasting formed '`:placeholder:`A`:diagtext:`', an invalid preprocessing token`| +----------------------------------------------------------------------------------------------------------------+ -Wjump-seh-finally ------------------ This diagnostic is enabled by default. **Diagnostic text:** +-------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`jump out of \_\_finally block has undefined behavior`| +-------------------------------------------------------------------------------------------+ -Wkeyword-compat ---------------- This diagnostic is enabled by default. **Diagnostic text:** +-----------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`keyword '`:placeholder:`A`:diagtext:`' will be made available as an identifier` |nbsp| |+-----------------------------------------------------+| | ||:diagtext:`here` || | |+-----------------------------------------------------+| | ||:diagtext:`for the remainder of the translation unit`|| | |+-----------------------------------------------------+| +-----------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------+ -Wkeyword-macro --------------- **Diagnostic text:** +----------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`keyword is hidden by macro definition`| +----------------------------------------------------------------------------+ -Wknr-promoted-parameter ------------------------ This diagnostic is enabled by default. **Diagnostic text:** +------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`promoted type of K&R function parameter is not compatible with parameter type` |nbsp| :diagtext:`declared in a previous prototype`| +------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wlanguage-extension-token -------------------------- **Diagnostic text:** +-----------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`extension used`| +-----------------------------------------------------+ -Wlarge-by-value-copy --------------------- This diagnostic is enabled by default. **Diagnostic text:** +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is a large (`:placeholder:`B` |nbsp| :diagtext:`bytes) pass-by-value argument; pass it by reference instead ?`| +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`return value of` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is a large (`:placeholder:`B` |nbsp| :diagtext:`bytes) pass-by-value object; pass it by reference instead ?`| +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wliblto -------- This diagnostic flag exists for GCC compatibility, and has no effect in Clang. -Wliteral-conversion -------------------- This diagnostic is enabled by default. **Diagnostic text:** +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`implicit conversion from` |nbsp| :placeholder:`A` |nbsp| :diagtext:`to` |nbsp| :placeholder:`B` |nbsp| :diagtext:`changes value from` |nbsp| :placeholder:`C` |nbsp| :diagtext:`to` |nbsp| :placeholder:`D`| +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ ++-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`implicit conversion of out of range value from` |nbsp| :placeholder:`A` |nbsp| :diagtext:`to` |nbsp| :placeholder:`B` |nbsp| :diagtext:`is undefined`| ++-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + -Wliteral-range --------------- This diagnostic is enabled by default. **Diagnostic text:** +----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`magnitude of floating-point constant too large for type` |nbsp| :placeholder:`A`:diagtext:`; maximum is` |nbsp| :placeholder:`B`| +----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`magnitude of floating-point constant too small for type` |nbsp| :placeholder:`A`:diagtext:`; minimum is` |nbsp| :placeholder:`B`| +----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wlocal-type-template-args -------------------------- Some of the diagnostics controlled by this flag are enabled by default. Also controls `-Wc++98-compat-local-type-template-args`_. **Diagnostic text:** +------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`template argument uses local type` |nbsp| :placeholder:`A`| +------------------------------------------------------------------------------------------------+ -Wlogical-not-parentheses ------------------------- This diagnostic is enabled by default. **Diagnostic text:** +--------------------------------------------------------------------------------------------------------+------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`logical not is only applied to the left hand side of this` |nbsp| |+----------------------------+| | ||:diagtext:`comparison` || | |+----------------------------+| | ||:diagtext:`bitwise operator`|| | |+----------------------------+| +--------------------------------------------------------------------------------------------------------+------------------------------+ -Wlogical-op-parentheses ------------------------ This diagnostic is enabled by default. **Diagnostic text:** +---------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'&&' within '\|\|'`| +---------------------------------------------------------+ -Wlong-long ----------- Also controls `-Wc++11-long-long`_. **Diagnostic text:** +-----------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'long long' is an extension when C99 mode is not enabled`| +-----------------------------------------------------------------------------------------------+ -Wloop-analysis --------------- Controls `-Wfor-loop-analysis`_, `-Wrange-loop-analysis`_. -Wmacro-redefined ----------------- This diagnostic is enabled by default. **Diagnostic text:** +------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`macro redefined`| +------------------------------------------------------------------------------+ -Wmain ------ Some of the diagnostics controlled by this flag are enabled by default. **Diagnostic text:** +--------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`ISO C++ does not allow 'main' to be used by a program`| +--------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'main' is not allowed to be declared \_Noreturn`| +--------------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'main' is not allowed to be declared variadic`| +------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`only one parameter on 'main' declaration`| +-------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`variable named 'main' with external linkage has undefined behavior`| +---------------------------------------------------------------------------------------------------------+ +------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`bool literal returned from 'main'`| +------------------------------------------------------------------------+ +---------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'main' should not be declared static`| +---------------------------------------------------------------------------+ -Wmain-return-type ------------------ This diagnostic is enabled by default. **Diagnostic text:** +-------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`return type of 'main' is not 'int'`| +-------------------------------------------------------------------------+ -Wmalformed-warning-check ------------------------- This diagnostic is enabled by default. **Diagnostic text:** +---------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`\_\_has\_warning expected option name (e.g. "-Wundef")`| +---------------------------------------------------------------------------------------------+ -Wmany-braces-around-scalar-init -------------------------------- This diagnostic is enabled by default. **Diagnostic text:** +--------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`too many braces around scalar initializer`| +--------------------------------------------------------------------------------+ -Wmax-unsigned-zero ------------------- This diagnostic is enabled by default. **Diagnostic text:** +----------------------------------------------------------------+---------------------------------------+------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`taking the max of` |nbsp| |+-------------------------------------+| |nbsp| :diagtext:`is always equal to the other value`| | ||:diagtext:`a value and unsigned zero`|| | | |+-------------------------------------+| | | ||:diagtext:`unsigned zero and a value`|| | | |+-------------------------------------+| | +----------------------------------------------------------------+---------------------------------------+------------------------------------------------------+ +-Wmemset-transposed-args +------------------------ +This diagnostic is enabled by default. + +**Diagnostic text:** + ++---------------------------+-----------------------------------------------------+---------------------------------------------------------------+ +|:warning:`warning:` |nbsp| |+---------------------------------------------------+|:diagtext:`; did you mean to transpose the last two arguments?`| +| ||:diagtext:`'size' argument to memset is '0'` || | +| |+---------------------------------------------------+| | +| ||:diagtext:`setting buffer to a 'sizeof' expression`|| | +| |+---------------------------------------------------+| | ++---------------------------+-----------------------------------------------------+---------------------------------------------------------------+ + + -Wmemsize-comparison -------------------- This diagnostic is enabled by default. **Diagnostic text:** +-----------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`size argument in` |nbsp| :placeholder:`A` |nbsp| :diagtext:`call is a comparison`| +-----------------------------------------------------------------------------------------------------------------------+ -Wmethod-signatures ------------------- **Diagnostic text:** +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`conflicting parameter types in implementation of` |nbsp| :placeholder:`A`:diagtext:`:` |nbsp| :placeholder:`B` |nbsp| :diagtext:`vs` |nbsp| :placeholder:`C`| +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`conflicting return type in implementation of` |nbsp| :placeholder:`A`:diagtext:`:` |nbsp| :placeholder:`B` |nbsp| :diagtext:`vs` |nbsp| :placeholder:`C`| +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wmicrosoft ----------- Some of the diagnostics controlled by this flag are enabled by default. Controls `-Winconsistent-dllimport`_, `-Wmicrosoft-anon-tag`_, `-Wmicrosoft-cast`_, `-Wmicrosoft-charize`_, `-Wmicrosoft-comment-paste`_, `-Wmicrosoft-const-init`_, `-Wmicrosoft-cpp-macro`_, `-Wmicrosoft-default-arg-redefinition`_, `-Wmicrosoft-end-of-file`_, `-Wmicrosoft-enum-forward-reference`_, `-Wmicrosoft-enum-value`_, `-Wmicrosoft-exception-spec`_, `-Wmicrosoft-explicit-constructor-call`_, `-Wmicrosoft-extra-qualification`_, `-Wmicrosoft-fixed-enum`_, `-Wmicrosoft-flexible-array`_, `-Wmicrosoft-goto`_, `-Wmicrosoft-include`_, `-Wmicrosoft-mutable-reference`_, `-Wmicrosoft-pure-definition`_, `-Wmicrosoft-redeclare-static`_, `-Wmicrosoft-sealed`_, `-Wmicrosoft-template`_, `-Wmicrosoft-union-member-reference`_, `-Wmicrosoft-unqualified-friend`_, `-Wmicrosoft-using-decl`_, `-Wmicrosoft-void-pseudo-dtor`_. -Wmicrosoft-anon-tag -------------------- Some of the diagnostics controlled by this flag are enabled by default. **Diagnostic text:** +-----------------------------------------------------------------------------+--------------------+---------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`types declared in an anonymous` |nbsp| |+------------------+| |nbsp| :diagtext:`are a Microsoft extension`| | ||:diagtext:`struct`|| | | |+------------------+| | | ||:diagtext:`union` || | | |+------------------+| | +-----------------------------------------------------------------------------+--------------------+---------------------------------------------+ +--------------------------------------------------------+---------------------+---------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`anonymous` |nbsp| |+-------------------+| |nbsp| :diagtext:`are a Microsoft extension`| | ||:diagtext:`structs`|| | | |+-------------------+| | | ||:diagtext:`unions` || | | |+-------------------+| | +--------------------------------------------------------+---------------------+---------------------------------------------+ -Wmicrosoft-cast ---------------- This diagnostic is enabled by default. **Diagnostic text:** +------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`static\_cast between pointer-to-function and pointer-to-object is a Microsoft extension`| +------------------------------------------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`implicit conversion between pointer-to-function and pointer-to-object is a Microsoft extension`| +-------------------------------------------------------------------------------------------------------------------------------------+ -Wmicrosoft-charize ------------------- **Diagnostic text:** +-------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`charizing operator #@ is a Microsoft extension`| +-------------------------------------------------------------------------------------+ -Wmicrosoft-comment-paste ------------------------- **Diagnostic text:** +----------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`pasting two '/' tokens into a '//' comment is a Microsoft extension`| +----------------------------------------------------------------------------------------------------------+ -Wmicrosoft-const-init ---------------------- This diagnostic is enabled by default. **Diagnostic text:** +----------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------+--------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`default initialization of an object of const type` |nbsp| :placeholder:`A`|+---------------------------------------------------------------+| |nbsp| :diagtext:`is a Microsoft extension`| | || || | | |+---------------------------------------------------------------+| | | || |nbsp| :diagtext:`without a user-provided default constructor`|| | | |+---------------------------------------------------------------+| | +----------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------+--------------------------------------------+ -Wmicrosoft-cpp-macro --------------------- **Diagnostic text:** +-------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`C++ operator` |nbsp| :placeholder:`A` |nbsp| :diagtext:`(aka` |nbsp| :placeholder:`B`:diagtext:`) used as a macro name`| +-------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wmicrosoft-default-arg-redefinition ------------------------------------ This diagnostic is enabled by default. **Diagnostic text:** +-----------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`redefinition of default argument`| +-----------------------------------------------------------------------+ -Wmicrosoft-end-of-file ----------------------- **Diagnostic text:** +----------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`treating Ctrl-Z as end-of-file is a Microsoft extension`| +----------------------------------------------------------------------------------------------+ -Wmicrosoft-enum-forward-reference ---------------------------------- This diagnostic is enabled by default. **Diagnostic text:** +---------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`forward references to 'enum' types are a Microsoft extension`| +---------------------------------------------------------------------------------------------------+ -Wmicrosoft-enum-value ---------------------- **Diagnostic text:** +---------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`enumerator value is not representable in the underlying type` |nbsp| :placeholder:`A`| +---------------------------------------------------------------------------------------------------------------------------+ -Wmicrosoft-exception-spec -------------------------- Some of the diagnostics controlled by this flag are enabled by default. **Diagnostic text:** +------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`exception specification of '...' is a Microsoft extension`| +------------------------------------------------------------------------------------------------+ +---------------------------+----------------------------------+----------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| |+--------------------------------+|:diagtext:`incomplete type` |nbsp| :placeholder:`B` |nbsp| :diagtext:`is not allowed in exception specification`| | || || | | |+--------------------------------+| | | ||:diagtext:`pointer to` |nbsp| || | | |+--------------------------------+| | | ||:diagtext:`reference to` |nbsp| || | | |+--------------------------------+| | +---------------------------+----------------------------------+----------------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`exception specification in declaration does not match previous declaration`| +-----------------------------------------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`exception specification in explicit instantiation does not match instantiated one`| +------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is missing exception specification '`:placeholder:`B`:diagtext:`'`| +--------------------------------------------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`exception specification of overriding function is more lax than base version`| +-------------------------------------------------------------------------------------------------------------------+ -Wmicrosoft-exists ------------------ This diagnostic is enabled by default. **Diagnostic text:** +--------------------------------------------------------+---------------------------------+--------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`dependent` |nbsp| |+-------------------------------+| |nbsp| :diagtext:`declarations are ignored`| | ||:diagtext:`\_\_if\_not\_exists`|| | | |+-------------------------------+| | | ||:diagtext:`\_\_if\_exists` || | | |+-------------------------------+| | +--------------------------------------------------------+---------------------------------+--------------------------------------------+ -Wmicrosoft-explicit-constructor-call ------------------------------------- This diagnostic is enabled by default. **Diagnostic text:** +-------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`explicit constructor calls are a Microsoft extension`| +-------------------------------------------------------------------------------------------+ -Wmicrosoft-extra-qualification ------------------------------- This diagnostic is enabled by default. **Diagnostic text:** +--------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`extra qualification on member` |nbsp| :placeholder:`A`| +--------------------------------------------------------------------------------------------+ -Wmicrosoft-fixed-enum ---------------------- **Diagnostic text:** +---------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`enumeration types with a fixed underlying type are a Microsoft extension`| +---------------------------------------------------------------------------------------------------------------+ -Wmicrosoft-flexible-array -------------------------- **Diagnostic text:** +----------------------------------------------------------------------------------------------------------------------------------+-----------------------+--------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`flexible array member` |nbsp| :placeholder:`A` |nbsp| :diagtext:`in otherwise empty` |nbsp| |+---------------------+| |nbsp| :diagtext:`is a Microsoft extension`| | ||:diagtext:`struct` || | | |+---------------------+| | | ||:diagtext:`interface`|| | | |+---------------------+| | | ||:diagtext:`union` || | | |+---------------------+| | | ||:diagtext:`class` || | | |+---------------------+| | | ||:diagtext:`enum` || | | |+---------------------+| | +----------------------------------------------------------------------------------------------------------------------------------+-----------------------+--------------------------------------------+ +-------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`flexible array member` |nbsp| :placeholder:`A` |nbsp| :diagtext:`in a union is a Microsoft extension`| +-------------------------------------------------------------------------------------------------------------------------------------------+ -Wmicrosoft-goto ---------------- This diagnostic is enabled by default. **Diagnostic text:** +----------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`jump from this goto statement to its label is a Microsoft extension`| +----------------------------------------------------------------------------------------------------------+ +-Wmicrosoft-inaccessible-base +----------------------------- +This diagnostic is enabled by default. + +**Diagnostic text:** + ++-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`accessing inaccessible direct base` |nbsp| :placeholder:`A` |nbsp| :diagtext:`of` |nbsp| :placeholder:`B` |nbsp| :diagtext:`is a Microsoft extension`| ++-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + + -Wmicrosoft-include ------------------- This diagnostic is enabled by default. **Diagnostic text:** +------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`#include resolved using non-portable Microsoft search rules as:` |nbsp| :placeholder:`A`| +------------------------------------------------------------------------------------------------------------------------------+ -Wmicrosoft-mutable-reference ----------------------------- This diagnostic is enabled by default. **Diagnostic text:** +---------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'mutable' on a reference type is a Microsoft extension`| +---------------------------------------------------------------------------------------------+ -Wmicrosoft-pure-definition --------------------------- This diagnostic is enabled by default. **Diagnostic text:** +-------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`function definition with pure-specifier is a Microsoft extension`| +-------------------------------------------------------------------------------------------------------+ -Wmicrosoft-redeclare-static ---------------------------- **Diagnostic text:** +-------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`redeclaring non-static` |nbsp| :placeholder:`A` |nbsp| :diagtext:`as static is a Microsoft extension`| +-------------------------------------------------------------------------------------------------------------------------------------------+ -Wmicrosoft-sealed ------------------ This diagnostic is enabled by default. **Diagnostic text:** +--------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'sealed' keyword is a Microsoft extension`| +--------------------------------------------------------------------------------+ -Wmicrosoft-template -------------------- This diagnostic is enabled by default. **Diagnostic text:** +------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`duplicate explicit instantiation of` |nbsp| :placeholder:`A` |nbsp| :diagtext:`ignored as a Microsoft extension`| +------------------------------------------------------------------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`use of identifier` |nbsp| :placeholder:`A` |nbsp| :diagtext:`found via unqualified lookup into dependent bases of class templates is a Microsoft extension`| +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -+--------------------------------------------------------------------------------------------------------------------------------------------------------+ -|:warning:`warning:` |nbsp| :diagtext:`explicit specialization of` |nbsp| :placeholder:`A` |nbsp| :diagtext:`within class scope is a Microsoft extension`| -+--------------------------------------------------------------------------------------------------------------------------------------------------------+ - +-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`using the undeclared type` |nbsp| :placeholder:`A` |nbsp| :diagtext:`as a default template argument is a Microsoft extension`| +-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`non-type template argument containing a dereference operation is a Microsoft extension`| +-----------------------------------------------------------------------------------------------------------------------------+ -+---------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -|:warning:`warning:` |nbsp| |+-------------------------------------+| |nbsp| :diagtext:`specialization of` |nbsp| :placeholder:`B` |nbsp| :diagtext:`outside namespace enclosing` |nbsp| :placeholder:`C` |nbsp| :diagtext:`is a Microsoft extension`| -| ||:diagtext:`class template` || | -| |+-------------------------------------+| | -| ||:diagtext:`class template partial` || | -| |+-------------------------------------+| | -| ||:diagtext:`variable template` || | -| |+-------------------------------------+| | -| ||:diagtext:`variable template partial`|| | -| |+-------------------------------------+| | -| ||:diagtext:`function template` || | -| |+-------------------------------------+| | -| ||:diagtext:`member function` || | -| |+-------------------------------------+| | -| ||:diagtext:`static data member` || | -| |+-------------------------------------+| | -| ||:diagtext:`member class` || | -| |+-------------------------------------+| | -| ||:diagtext:`member enumeration` || | -| |+-------------------------------------+| | -+---------------------------+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ ++---------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------+--------------------------------------------+ +|:warning:`warning:` |nbsp| |+-------------------------------------+| |nbsp| :diagtext:`specialization of` |nbsp| :placeholder:`B` |nbsp| :diagtext:`not in` |nbsp| |+----------------------------------------------------------------------------------------+| |nbsp| :diagtext:`is a Microsoft extension`| +| ||:diagtext:`class template` || ||+---------------------------------------------------------+ || | +| |+-------------------------------------+| |||:diagtext:`a namespace enclosing` |nbsp| :placeholder:`C`| || | +| ||:diagtext:`class template partial` || ||+---------------------------------------------------------+ || | +| |+-------------------------------------+| |+----------------------------------------------------------------------------------------+| | +| ||:diagtext:`variable template` || ||+--------------------------------------------------------------------------------------+|| | +| |+-------------------------------------+| |||:diagtext:`class` |nbsp| :placeholder:`C` |nbsp| :diagtext:`or an enclosing namespace`||| | +| ||:diagtext:`variable template partial`|| ||+--------------------------------------------------------------------------------------+|| | +| |+-------------------------------------+| |+----------------------------------------------------------------------------------------+| | +| ||:diagtext:`function template` || | | | +| |+-------------------------------------+| | | | +| ||:diagtext:`member function` || | | | +| |+-------------------------------------+| | | | +| ||:diagtext:`static data member` || | | | +| |+-------------------------------------+| | | | +| ||:diagtext:`member class` || | | | +| |+-------------------------------------+| | | | +| ||:diagtext:`member enumeration` || | | | +| |+-------------------------------------+| | | | ++---------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------+--------------------------------------------+ +------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`template argument for template type parameter must be a type; omitted 'typename' is a Microsoft extension`| +------------------------------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`use of undeclared identifier` |nbsp| :placeholder:`A`:diagtext:`; unqualified lookup into dependent bases of class template` |nbsp| :placeholder:`B` |nbsp| :diagtext:`is a Microsoft extension`| +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wmicrosoft-union-member-reference ---------------------------------- This diagnostic is enabled by default. **Diagnostic text:** +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`union member` |nbsp| :placeholder:`A` |nbsp| :diagtext:`has reference type` |nbsp| :placeholder:`B`:diagtext:`, which is a Microsoft extension`| +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wmicrosoft-unqualified-friend ------------------------------ This diagnostic is enabled by default. **Diagnostic text:** +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`unqualified friend declaration referring to type outside of the nearest enclosing namespace is a Microsoft extension; add a nested name specifier`| +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wmicrosoft-using-decl ---------------------- This diagnostic is enabled by default. **Diagnostic text:** +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`using declaration referring to inaccessible member '`:placeholder:`A`:diagtext:`' (which refers to accessible member '`:placeholder:`B`:diagtext:`') is a Microsoft compatibility extension`| +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wmicrosoft-void-pseudo-dtor ---------------------------- This diagnostic is enabled by default. **Diagnostic text:** +------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`pseudo-destructors on type void are a Microsoft extension`| +------------------------------------------------------------------------------------------------+ -Wmismatched-new-delete ----------------------- This diagnostic is enabled by default. **Diagnostic text:** +----------------------------------------------+------------------+---------------------------------------------------------------+------------------+-----------------------------------+------------------+--------------+ |:warning:`warning:` |nbsp| :diagtext:`'delete`|+----------------+|:diagtext:`' applied to a pointer that was allocated with 'new`|+----------------+|:diagtext:`'; did you mean 'delete`|+----------------+|:diagtext:`'?`| | || || ||:diagtext:`\[\]`|| ||:diagtext:`\[\]`|| | | |+----------------+| |+----------------+| |+----------------+| | | ||:diagtext:`\[\]`|| || || || || | | |+----------------+| |+----------------+| |+----------------+| | +----------------------------------------------+------------------+---------------------------------------------------------------+------------------+-----------------------------------+------------------+--------------+ -Wmismatched-parameter-types ---------------------------- This diagnostic is enabled by default. **Diagnostic text:** +---------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`conflicting parameter types in implementation of` |nbsp| :placeholder:`A`| +---------------------------------------------------------------------------------------------------------------+ -Wmismatched-return-types ------------------------- This diagnostic is enabled by default. **Diagnostic text:** +-----------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`conflicting return type in implementation of` |nbsp| :placeholder:`A`| +-----------------------------------------------------------------------------------------------------------+ -Wmismatched-tags ----------------- **Diagnostic text:** +---------------------------------------------------------------------------------+--------------------------+------------------------------+-----------------------------------------------------------+--------------------------+------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`C` |nbsp| :diagtext:`defined as` |nbsp| |+------------------------+|+----------------------------+| |nbsp| :diagtext:`here but previously declared as` |nbsp| |+------------------------+|+----------------------------+| | ||:diagtext:`a struct` ||| || ||:diagtext:`a struct` ||| || | |+------------------------+|+----------------------------+| |+------------------------+|+----------------------------+| | ||:diagtext:`an interface`||| |nbsp| :diagtext:`template`|| ||:diagtext:`an interface`||| |nbsp| :diagtext:`template`|| | |+------------------------+|+----------------------------+| |+------------------------+|+----------------------------+| | ||:diagtext:`a class` || | ||:diagtext:`a class` || | | |+------------------------+| | |+------------------------+| | +---------------------------------------------------------------------------------+--------------------------+------------------------------+-----------------------------------------------------------+--------------------------+------------------------------+ +---------------------------+-----------------------+------------------------------+--------------------------------------------------------------------------------+-----------------------+------------------------------+ |:warning:`warning:` |nbsp| |+---------------------+|+----------------------------+| |nbsp| :placeholder:`C` |nbsp| :diagtext:`was previously declared as a` |nbsp| |+---------------------+|+----------------------------+| | ||:diagtext:`struct` ||| || ||:diagtext:`struct` ||| || | |+---------------------+|+----------------------------+| |+---------------------+|+----------------------------+| | ||:diagtext:`interface`||| |nbsp| :diagtext:`template`|| ||:diagtext:`interface`||| |nbsp| :diagtext:`template`|| | |+---------------------+|+----------------------------+| |+---------------------+|+----------------------------+| | ||:diagtext:`class` || | ||:diagtext:`class` || | | |+---------------------+| | |+---------------------+| | +---------------------------+-----------------------+------------------------------+--------------------------------------------------------------------------------+-----------------------+------------------------------+ -Wmissing-braces ---------------- **Diagnostic text:** +----------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`suggest braces around initialization of subobject`| +----------------------------------------------------------------------------------------+ -Wmissing-declarations ---------------------- This diagnostic is enabled by default. **Diagnostic text:** +----------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`declaration does not declare anything`| +----------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'`:placeholder:`A`:diagtext:`' is not permitted on a declaration of a type`| +-----------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`typedef requires a name`| +--------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'`:placeholder:`A`:diagtext:`' ignored on this declaration`| +-------------------------------------------------------------------------------------------------+ -Wmissing-exception-spec ------------------------ This diagnostic is enabled by default. **Diagnostic text:** +--------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is missing exception specification '`:placeholder:`B`:diagtext:`'`| +--------------------------------------------------------------------------------------------------------------------------------+ -Wmissing-field-initializers ---------------------------- **Diagnostic text:** +-----------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`missing field` |nbsp| :placeholder:`A` |nbsp| :diagtext:`initializer`| +-----------------------------------------------------------------------------------------------------------+ -Wmissing-format-attribute -------------------------- This diagnostic flag exists for GCC compatibility, and has no effect in Clang. -Wmissing-include-dirs ---------------------- This diagnostic flag exists for GCC compatibility, and has no effect in Clang. -Wmissing-method-return-type ---------------------------- **Diagnostic text:** +--------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`method has no return type specified; defaults to 'id'`| +--------------------------------------------------------------------------------------------+ -Wmissing-noescape ------------------ This diagnostic is enabled by default. **Diagnostic text:** +----------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`parameter of overriding method should be annotated with \_\_attribute\_\_((noescape))`| +----------------------------------------------------------------------------------------------------------------------------+ -Wmissing-noreturn ------------------ **Diagnostic text:** +----------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`block could be declared with attribute 'noreturn'`| +----------------------------------------------------------------------------------------+ +---------------------------+----------------------+---------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| |+--------------------+| |nbsp| :placeholder:`B` |nbsp| :diagtext:`could be declared with attribute 'noreturn'`| | ||:diagtext:`function`|| | | |+--------------------+| | | ||:diagtext:`method` || | | |+--------------------+| | +---------------------------+----------------------+---------------------------------------------------------------------------------------+ -Wmissing-prototype-for-cc -------------------------- This diagnostic is enabled by default. **Diagnostic text:** +----------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`function with no prototype cannot use the` |nbsp| :placeholder:`A` |nbsp| :diagtext:`calling convention`| +----------------------------------------------------------------------------------------------------------------------------------------------+ -Wmissing-prototypes -------------------- **Diagnostic text:** +-------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`no previous prototype for function` |nbsp| :placeholder:`A`| +-------------------------------------------------------------------------------------------------+ -Wmissing-selector-name ----------------------- This diagnostic is enabled by default. **Diagnostic text:** +---------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`used as the name of the previous parameter rather than as part of the selector`| +---------------------------------------------------------------------------------------------------------------------------------------------+ -Wmissing-sysroot ----------------- This diagnostic is enabled by default. **Diagnostic text:** +------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`no such sysroot directory: '`:placeholder:`A`:diagtext:`'`| +------------------------------------------------------------------------------------------------+ -Wmissing-variable-declarations ------------------------------- **Diagnostic text:** +---------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`no previous extern declaration for non-static variable` |nbsp| :placeholder:`A`| +---------------------------------------------------------------------------------------------------------------------+ -Rmodule-build -------------- **Diagnostic text:** +---------------------------------------------------------------------------------------------------------------------+ |:remark:`remark:` |nbsp| :diagtext:`building module '`:placeholder:`A`:diagtext:`' as '`:placeholder:`B`:diagtext:`'`| +---------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------+ |:remark:`remark:` |nbsp| :diagtext:`finished building module '`:placeholder:`A`:diagtext:`'`| +--------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------------------------------+ |:remark:`remark:` |nbsp| :diagtext:`could not acquire lock file for module '`:placeholder:`A`:diagtext:`':` |nbsp| :placeholder:`B`| +-----------------------------------------------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------------------------------+ |:remark:`remark:` |nbsp| :diagtext:`timed out waiting to acquire lock file for module '`:placeholder:`A`:diagtext:`'`| +---------------------------------------------------------------------------------------------------------------------+ -Wmodule-conflict ----------------- This diagnostic is enabled by default. **Diagnostic text:** +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`module '`:placeholder:`A`:diagtext:`' conflicts with already-imported module '`:placeholder:`B`:diagtext:`':` |nbsp| :placeholder:`C`| +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`module file '`:placeholder:`A`:diagtext:`' was validated as a system module and is now being imported as a non-system module; any difference in diagnostic options will be ignored`| +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wmodule-file-config-mismatch ----------------------------- This diagnostic is an error by default, but the flag ``-Wno-module-file-config-mismatch`` can be used to disable the error. **Diagnostic text:** +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:error:`error:` |nbsp| :diagtext:`module file` |nbsp| :placeholder:`A` |nbsp| :diagtext:`cannot be loaded due to a configuration mismatch with the current compilation`| +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wmodule-file-extension ----------------------- This diagnostic is enabled by default. **Diagnostic text:** +----------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`duplicate module file extension block name '`:placeholder:`A`:diagtext:`'`| +----------------------------------------------------------------------------------------------------------------+ -Wmodule-import-in-extern-c --------------------------- This diagnostic is an error by default, but the flag ``-Wno-module-import-in-extern-c`` can be used to disable the error. **Diagnostic text:** +-----------------------------------------------------------------------------------------------------------------------------------------------+ |:error:`error:` |nbsp| :diagtext:`import of C++ module '`:placeholder:`A`:diagtext:`' appears within extern "C" language linkage specification`| +-----------------------------------------------------------------------------------------------------------------------------------------------+ -Wmodules-ambiguous-internal-linkage ------------------------------------ This diagnostic is enabled by default. **Diagnostic text:** +-----------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`ambiguous use of internal linkage declaration` |nbsp| :placeholder:`A` |nbsp| :diagtext:`defined in multiple modules`| +-----------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wmodules-import-nested-redundant --------------------------------- This diagnostic is an error by default, but the flag ``-Wno-modules-import-nested-redundant`` can be used to disable the error. **Diagnostic text:** +-------------------------------------------------------------------------------------------------------------------------------------+ |:error:`error:` |nbsp| :diagtext:`redundant #include of module '`:placeholder:`A`:diagtext:`' appears within` |nbsp| :placeholder:`B`| +-------------------------------------------------------------------------------------------------------------------------------------+ -Wmost ------ Some of the diagnostics controlled by this flag are enabled by default. Controls `-Wcast-of-sel-type`_, `-Wchar-subscripts`_, `-Wcomment`_, `-Wdelete-non-virtual-dtor`_, `-Wextern-c-compat`_, `-Wfor-loop-analysis`_, `-Wformat`_, `-Wimplicit`_, `-Winfinite-recursion`_, `-Wmismatched-tags`_, `-Wmissing-braces`_, `-Wmove`_, `-Wmultichar`_, `-Wobjc-designated-initializers`_, `-Wobjc-flexible-array`_, `-Wobjc-missing-super-calls`_, `-Woverloaded-virtual`_, `-Wprivate-extern`_, `-Wreorder`_, `-Wreturn-type`_, `-Wself-assign`_, `-Wself-move`_, `-Wsizeof-array-argument`_, `-Wsizeof-array-decay`_, `-Wstring-plus-int`_, `-Wtrigraphs`_, `-Wuninitialized`_, `-Wunknown-pragmas`_, `-Wunused`_, `-Wuser-defined-warnings`_, `-Wvolatile-register-var`_. -Wmove ------ -Controls `-Wpessimizing-move`_, `-Wredundant-move`_, `-Wself-move`_. +Controls `-Wpessimizing-move`_, `-Wredundant-move`_, `-Wreturn-std-move`_, `-Wself-move`_. -Wmsvc-include -------------- Synonym for `-Wmicrosoft-include`_. -Wmsvc-not-found ---------------- This diagnostic is enabled by default. **Diagnostic text:** +-------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`unable to find a Visual Studio installation; try running Clang from a developer command prompt`| +-------------------------------------------------------------------------------------------------------------------------------------+ -Wmultichar ----------- This diagnostic is enabled by default. **Diagnostic text:** +-------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`multi-character character constant`| +-------------------------------------------------------------------------+ -Wmultiple-move-vbase --------------------- This diagnostic is enabled by default. **Diagnostic text:** +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`defaulted move assignment operator of` |nbsp| :placeholder:`A` |nbsp| :diagtext:`will move assign virtual base class` |nbsp| :placeholder:`B` |nbsp| :diagtext:`multiple times`| +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wnarrowing ----------- Synonym for `-Wc++11-narrowing`_. -Wnested-anon-types ------------------- **Diagnostic text:** +---------------------------------------------------------------------------------------+--------------------+------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`anonymous types declared in an anonymous` |nbsp| |+------------------+| |nbsp| :diagtext:`are an extension`| | ||:diagtext:`struct`|| | | |+------------------+| | | ||:diagtext:`union` || | | |+------------------+| | +---------------------------------------------------------------------------------------+--------------------+------------------------------------+ -Wnested-externs ---------------- This diagnostic flag exists for GCC compatibility, and has no effect in Clang. -Wnew-returns-null ------------------ This diagnostic is enabled by default. **Diagnostic text:** +-------------------------------------------------------------------------------------------------------------------------------+-----------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`should not return a null pointer unless it is declared 'throw()'`|+---------------------------------+| | || || | |+---------------------------------+| | || |nbsp| :diagtext:`or 'noexcept'`|| | |+---------------------------------+| +-------------------------------------------------------------------------------------------------------------------------------+-----------------------------------+ -Wnewline-eof ------------- **Diagnostic text:** +----------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`no newline at end of file`| +----------------------------------------------------------------+ +----------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`no newline at end of file`| +----------------------------------------------------------------+ -Wnoexcept-type --------------- Synonym for `-Wc++17-compat-mangling`_. -Wnon-gcc --------- Some of the diagnostics controlled by this flag are enabled by default. Controls `-Wconversion`_, `-Wliteral-range`_, `-Wsign-compare`_. -Wnon-literal-null-conversion ----------------------------- This diagnostic is enabled by default. **Diagnostic text:** +--------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`expression which evaluates to zero treated as a null pointer constant of type` |nbsp| :placeholder:`A`| +--------------------------------------------------------------------------------------------------------------------------------------------+ -Wnon-modular-include-in-framework-module ----------------------------------------- **Diagnostic text:** +-----------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`include of non-modular header inside framework module '`:placeholder:`A`:diagtext:`': '`:placeholder:`B`:diagtext:`'`| +-----------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wnon-modular-include-in-module ------------------------------- Also controls `-Wnon-modular-include-in-framework-module`_. **Diagnostic text:** +-------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`include of non-modular header inside module '`:placeholder:`A`:diagtext:`': '`:placeholder:`B`:diagtext:`'`| +-------------------------------------------------------------------------------------------------------------------------------------------------+ -Wnon-pod-varargs ----------------- This diagnostic is an error by default, but the flag ``-Wno-non-pod-varargs`` can be used to disable the error. **Diagnostic text:** +----------------------------------------------------------------+-------------------------+--------------------------------------------------------------------------------------------+-------------------------+----------------------------------------+ |:error:`error:` |nbsp| :diagtext:`cannot pass object of` |nbsp| |+-----------------------+| |nbsp| :diagtext:`type` |nbsp| :placeholder:`B` |nbsp| :diagtext:`through variadic` |nbsp| |+-----------------------+|:diagtext:`; call will abort at runtime`| | ||:diagtext:`non-POD` || ||:diagtext:`function` || | | |+-----------------------+| |+-----------------------+| | | ||:diagtext:`non-trivial`|| ||:diagtext:`block` || | | |+-----------------------+| |+-----------------------+| | | | | ||:diagtext:`method` || | | | | |+-----------------------+| | | | | ||:diagtext:`constructor`|| | | | | |+-----------------------+| | +----------------------------------------------------------------+-------------------------+--------------------------------------------------------------------------------------------+-------------------------+----------------------------------------+ +------------------------------------------------------+-------------------------+-------------------------------------------------------------------------------------------------+-------------------------+--------------------------------------------------------------------------+ |:error:`error:` |nbsp| :diagtext:`cannot pass` |nbsp| |+-----------------------+| |nbsp| :diagtext:`object of type` |nbsp| :placeholder:`B` |nbsp| :diagtext:`to variadic` |nbsp| |+-----------------------+|:diagtext:`; expected type from format string was` |nbsp| :placeholder:`D`| | ||:diagtext:`non-POD` || ||:diagtext:`function` || | | |+-----------------------+| |+-----------------------+| | | ||:diagtext:`non-trivial`|| ||:diagtext:`block` || | | |+-----------------------+| |+-----------------------+| | | | | ||:diagtext:`method` || | | | | |+-----------------------+| | | | | ||:diagtext:`constructor`|| | | | | |+-----------------------+| | +------------------------------------------------------+-------------------------+-------------------------------------------------------------------------------------------------+-------------------------+--------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------------+ |:error:`error:` |nbsp| :diagtext:`second argument to 'va\_arg' is of non-POD type` |nbsp| :placeholder:`A`| +----------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------------------------+ |:error:`error:` |nbsp| :diagtext:`second argument to 'va\_arg' is of ARC ownership-qualified type` |nbsp| :placeholder:`A`| +--------------------------------------------------------------------------------------------------------------------------+ -Wnon-virtual-dtor ------------------ **Diagnostic text:** +---------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`has virtual functions but non-virtual destructor`| +---------------------------------------------------------------------------------------------------------------+ -Wnonnull --------- This diagnostic is enabled by default. **Diagnostic text:** +------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`null passed to a callee that requires a non-null argument`| +------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------+----------------------+---------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`null returned from` |nbsp| |+--------------------+| |nbsp| :diagtext:`that requires a non-null return value`| | ||:diagtext:`function`|| | | |+--------------------+| | | ||:diagtext:`method` || | | |+--------------------+| | +-----------------------------------------------------------------+----------------------+---------------------------------------------------------+ -Wnonportable-cfstrings ----------------------- This diagnostic flag exists for GCC compatibility, and has no effect in Clang. -Wnonportable-include-path -------------------------- This diagnostic is enabled by default. **Diagnostic text:** +------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`non-portable path to file '`:placeholder:`A`:diagtext:`'; specified path differs in case from file name on disk`| +------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wnonportable-system-include-path --------------------------------- **Diagnostic text:** +------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`non-portable path to file '`:placeholder:`A`:diagtext:`'; specified path differs in case from file name on disk`| +------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wnonportable-vector-initialization ----------------------------------- This diagnostic is enabled by default. **Diagnostic text:** +---------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`vector initializers are not compatible with NEON intrinsics in big endian mode`| +---------------------------------------------------------------------------------------------------------------------+ +-Wnontrivial-memaccess +---------------------- +This diagnostic is enabled by default. + +**Diagnostic text:** + ++---------------------------+-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------+ +|:warning:`warning:` |nbsp| |+-----------------------------+| |nbsp| :diagtext:`this` |nbsp| :placeholder:`B` |nbsp| :diagtext:`call is a pointer to record` |nbsp| :placeholder:`C` |nbsp| :diagtext:`that is not trivial to` |nbsp| |+----------------------------------------+| +| ||:diagtext:`destination for` || ||:diagtext:`primitive-default-initialize`|| +| |+-----------------------------+| |+----------------------------------------+| +| ||:diagtext:`source of` || ||:diagtext:`primitive-copy` || +| |+-----------------------------+| |+----------------------------------------+| +| ||:diagtext:`first operand of` || | | +| |+-----------------------------+| | | +| ||:diagtext:`second operand of`|| | | +| |+-----------------------------+| | | ++---------------------------+-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------+ + + -Wnsconsumed-mismatch --------------------- This diagnostic is enabled by default. **Diagnostic text:** +---------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`overriding method has mismatched ns\_consumed attribute on its parameter`| +---------------------------------------------------------------------------------------------------------------+ -Wnsreturns-mismatch -------------------- This diagnostic is enabled by default. **Diagnostic text:** +-------------------------------------------------------------------------------------+---------------------------+------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`overriding method has mismatched ns\_returns\_`|+-------------------------+| |nbsp| :diagtext:`attributes`| | ||:diagtext:`not\_retained`|| | | |+-------------------------+| | | ||:diagtext:`retained` || | | |+-------------------------+| | +-------------------------------------------------------------------------------------+---------------------------+------------------------------+ -Wnull-arithmetic ----------------- This diagnostic is enabled by default. **Diagnostic text:** +--------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`use of NULL in arithmetic operation`| +--------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------+--------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`comparison between NULL and non-pointer` |nbsp| |+------------------------------------------------------------+| | ||+----------------------------------------------------------+|| | |||:diagtext:`(`:placeholder:`B` |nbsp| :diagtext:`and NULL)`||| | ||+----------------------------------------------------------+|| | |+------------------------------------------------------------+| | ||+----------------------------------------------------------+|| | |||:diagtext:`(NULL and` |nbsp| :placeholder:`B`:diagtext:`)`||| | ||+----------------------------------------------------------+|| | |+------------------------------------------------------------+| +--------------------------------------------------------------------------------------+--------------------------------------------------------------+ -Wnull-character ---------------- This diagnostic is enabled by default. **Diagnostic text:** +-----------------------------------------------------------------------------+--------------------+---------------------------+ |:warning:`warning:` |nbsp| :diagtext:`null character(s) preserved in` |nbsp| |+------------------+| |nbsp| :diagtext:`literal`| | ||:diagtext:`char` || | | |+------------------+| | | ||:diagtext:`string`|| | | |+------------------+| | +-----------------------------------------------------------------------------+--------------------+---------------------------+ +-------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`null character ignored`| +-------------------------------------------------------------+ -Wnull-conversion ----------------- This diagnostic is enabled by default. **Diagnostic text:** +---------------------------------------------------------------------+---------------------+-------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`implicit conversion of` |nbsp| |+-------------------+| |nbsp| :diagtext:`constant to` |nbsp| :placeholder:`B`| | ||:diagtext:`NULL` || | | |+-------------------+| | | ||:diagtext:`nullptr`|| | | |+-------------------+| | +---------------------------------------------------------------------+---------------------+-------------------------------------------------------+ -Wnull-dereference ------------------ This diagnostic is enabled by default. **Diagnostic text:** +------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`binding dereferenced null pointer to reference has undefined behavior`| +------------------------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`indirection of non-volatile null pointer will be deleted, not trap`| +---------------------------------------------------------------------------------------------------------+ -Wnull-pointer-arithmetic ------------------------- **Diagnostic text:** +--------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`arithmetic on a null pointer treated as a cast from integer to pointer is a GNU extension`| +--------------------------------------------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------------------+----------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`performing pointer arithmetic on a null pointer has undefined behavior`|+--------------------------------------------+| | || || | |+--------------------------------------------+| | || |nbsp| :diagtext:`if the offset is nonzero`|| | |+--------------------------------------------+| +-------------------------------------------------------------------------------------------------------------+----------------------------------------------+ -Wnullability ------------- This diagnostic is enabled by default. **Diagnostic text:** +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`conflicting nullability specifier on parameter types,` |nbsp| :placeholder:`A` |nbsp| :diagtext:`conflicts with existing specifier` |nbsp| :placeholder:`B`| +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`conflicting nullability specifier on return types,` |nbsp| :placeholder:`A` |nbsp| :diagtext:`conflicts with existing specifier` |nbsp| :placeholder:`B`| +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`nullability specifier` |nbsp| :placeholder:`A` |nbsp| :diagtext:`conflicts with existing specifier` |nbsp| :placeholder:`B`| +-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`synthesized setter` |nbsp| :placeholder:`A` |nbsp| :diagtext:`for null\_resettable property` |nbsp| :placeholder:`B` |nbsp| :diagtext:`does not handle nil`| +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`duplicate nullability specifier` |nbsp| :placeholder:`A`| +----------------------------------------------------------------------------------------------+ -Wnullability-completeness -------------------------- This diagnostic is enabled by default. Also controls `-Wnullability-completeness-on-arrays`_. **Diagnostic text:** +---------------------------+----------------------------+-----------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| |+--------------------------+| |nbsp| :diagtext:`is missing a nullability type specifier (\_Nonnull, \_Nullable, or \_Null\_unspecified)`| | ||:diagtext:`pointer` || | | |+--------------------------+| | | ||:diagtext:`block pointer` || | | |+--------------------------+| | | ||:diagtext:`member pointer`|| | | |+--------------------------+| | +---------------------------+----------------------------+-----------------------------------------------------------------------------------------------------------+ -Wnullability-completeness-on-arrays ------------------------------------ This diagnostic is enabled by default. **Diagnostic text:** +----------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`array parameter is missing a nullability type specifier (\_Nonnull, \_Nullable, or \_Null\_unspecified)`| +----------------------------------------------------------------------------------------------------------------------------------------------+ -Wnullability-declspec ---------------------- This diagnostic is an error by default, but the flag ``-Wno-nullability-declspec`` can be used to disable the error. **Diagnostic text:** +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------+-------------+ |:error:`error:` |nbsp| :diagtext:`nullability specifier` |nbsp| :placeholder:`A` |nbsp| :diagtext:`cannot be applied to non-pointer type` |nbsp| :placeholder:`B`:diagtext:`; did you mean to apply the specifier to the` |nbsp| |+-----------------------------------+|:diagtext:`?`| | ||:diagtext:`pointer` || | | |+-----------------------------------+| | | ||:diagtext:`block pointer` || | | |+-----------------------------------+| | | ||:diagtext:`member pointer` || | | |+-----------------------------------+| | | ||:diagtext:`function pointer` || | | |+-----------------------------------+| | | ||:diagtext:`member function pointer`|| | | |+-----------------------------------+| | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------+-------------+ -Wnullability-extension ----------------------- **Diagnostic text:** +---------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`type nullability specifier` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is a Clang extension`| +---------------------------------------------------------------------------------------------------------------------------------+ -Wnullability-inferred-on-nested-type ------------------------------------- This diagnostic is enabled by default. **Diagnostic text:** +--------------------------------------------------------------------------------------------+-----------------------+---------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`inferring '\_Nonnull' for pointer type within` |nbsp| |+---------------------+| |nbsp| :diagtext:`is deprecated`| | ||:diagtext:`array` || | | |+---------------------+| | | ||:diagtext:`reference`|| | | |+---------------------+| | +--------------------------------------------------------------------------------------------+-----------------------+---------------------------------+ -Wnullable-to-nonnull-conversion -------------------------------- **Diagnostic text:** +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`implicit conversion from nullable pointer` |nbsp| :placeholder:`A` |nbsp| :diagtext:`to non-nullable pointer type` |nbsp| :placeholder:`B`| +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wobjc-autosynthesis-property-ivar-name-match --------------------------------------------- This diagnostic is enabled by default. **Diagnostic text:** +---------------------------------------------------------------------------------------------------------------------------+-------------------------+---------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`autosynthesized property` |nbsp| :placeholder:`A` |nbsp| :diagtext:`will use` |nbsp| |+-----------------------+| |nbsp| :diagtext:`instance variable` |nbsp| :placeholder:`C`:diagtext:`, not existing instance variable` |nbsp| :placeholder:`D`| | || || | | |+-----------------------+| | | ||:diagtext:`synthesized`|| | | |+-----------------------+| | +---------------------------------------------------------------------------------------------------------------------------+-------------------------+---------------------------------------------------------------------------------------------------------------------------------+ -Wobjc-circular-container ------------------------- This diagnostic is enabled by default. **Diagnostic text:** -+-----------------------------------------------------------------------------------------------------------------------------------------------------------+ -|:warning:`warning:` |nbsp| :diagtext:`adding '`:placeholder:`A`:diagtext:`' to '`:placeholder:`B`:diagtext:`' might cause circular dependency in container`| -+-----------------------------------------------------------------------------------------------------------------------------------------------------------+ ++-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`adding` |nbsp| :placeholder:`A` |nbsp| :diagtext:`to` |nbsp| :placeholder:`B` |nbsp| :diagtext:`might cause circular dependency in container`| ++-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wobjc-cocoa-api ---------------- Synonym for `-Wobjc-redundant-api-use`_. -Wobjc-designated-initializers ------------------------------ This diagnostic is enabled by default. **Diagnostic text:** +-----------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`designated initializer missing a 'super' call to a designated initializer of the super class`| +-----------------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`designated initializer invoked a non-designated initializer`| +--------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`designated initializer should only invoke a designated initializer on 'super'`| +--------------------------------------------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`method override for the designated initializer of the superclass` |nbsp| :placeholder:`A` |nbsp| :diagtext:`not found`| +------------------------------------------------------------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`convenience initializer missing a 'self' call to another initializer`| +-----------------------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`convenience initializer should not invoke an initializer on 'super'`| +----------------------------------------------------------------------------------------------------------+ -Wobjc-flexible-array --------------------- This diagnostic is enabled by default. **Diagnostic text:** +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`field` |nbsp| :placeholder:`A` |nbsp| :diagtext:`can overwrite instance variable` |nbsp| :placeholder:`B` |nbsp| :diagtext:`with variable sized type` |nbsp| :placeholder:`C` |nbsp| :diagtext:`in superclass` |nbsp| :placeholder:`D`| +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`field` |nbsp| :placeholder:`A` |nbsp| :diagtext:`with variable sized type` |nbsp| :placeholder:`B` |nbsp| :diagtext:`is not visible to subclasses and can conflict with their instance variables`| +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wobjc-forward-class-redefinition --------------------------------- This diagnostic is enabled by default. **Diagnostic text:** +--------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`redefinition of forward class` |nbsp| :placeholder:`A` |nbsp| :diagtext:`of a typedef name of an object type is ignored`| +--------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wobjc-interface-ivars ---------------------- **Diagnostic text:** +-------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`declaration of instance variables in the interface is deprecated`| +-------------------------------------------------------------------------------------------------------+ -Wobjc-literal-compare ---------------------- This diagnostic is enabled by default. Also controls `-Wobjc-string-compare`_. **Diagnostic text:** +-------------------------------------------------------------------+----------------------------------+------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`direct comparison of` |nbsp| |+--------------------------------+| |nbsp| :diagtext:`has undefined behavior`| | ||:diagtext:`an array literal` || | | |+--------------------------------+| | | ||:diagtext:`a dictionary literal`|| | | |+--------------------------------+| | | ||:diagtext:`a numeric literal` || | | |+--------------------------------+| | | ||:diagtext:`a boxed expression` || | | |+--------------------------------+| | | || || | | |+--------------------------------+| | +-------------------------------------------------------------------+----------------------------------+------------------------------------------+ -Wobjc-literal-conversion ------------------------- This diagnostic is enabled by default. **Diagnostic text:** +-------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`implicit boolean conversion of Objective-C object literal always evaluates to true`| +-------------------------------------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------------------------------------+-----------------------------------+------------------------+ |:warning:`warning:` |nbsp| :diagtext:`object of type` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is not compatible with` |nbsp| |+---------------------------------+| |nbsp| :placeholder:`C`| | ||:diagtext:`array element type` || | | |+---------------------------------+| | | ||:diagtext:`dictionary key type` || | | |+---------------------------------+| | | ||:diagtext:`dictionary value type`|| | | |+---------------------------------+| | +-------------------------------------------------------------------------------------------------------------------------------+-----------------------------------+------------------------+ -Wobjc-macro-redefinition ------------------------- This diagnostic is enabled by default. **Diagnostic text:** +-------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`ignoring redefinition of Objective-C qualifier macro`| +-------------------------------------------------------------------------------------------+ -Wobjc-messaging-id ------------------- **Diagnostic text:** +---------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`messaging unqualified id`| +---------------------------------------------------------------+ -Wobjc-method-access -------------------- This diagnostic is enabled by default. **Diagnostic text:** +---------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`class method` |nbsp| :placeholder:`A` |nbsp| :diagtext:`not found (return type defaults to 'id')`| +---------------------------------------------------------------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`class method` |nbsp| :placeholder:`A` |nbsp| :diagtext:`not found (return type defaults to 'id'); did you mean` |nbsp| :placeholder:`C`:diagtext:`?`| +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`instance method` |nbsp| :placeholder:`A` |nbsp| :diagtext:`not found (return type defaults to 'id')`| +------------------------------------------------------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`instance method` |nbsp| :placeholder:`A` |nbsp| :diagtext:`not found (return type defaults to 'id'); did you mean` |nbsp| :placeholder:`C`:diagtext:`?`| +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`instance method` |nbsp| :placeholder:`A` |nbsp| :diagtext:`found instead of class method` |nbsp| :placeholder:`B`| +-------------------------------------------------------------------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`instance method` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is being used on 'Class' which is not in the root class`| +---------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wobjc-missing-property-synthesis --------------------------------- **Diagnostic text:** +------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`auto property synthesis is synthesizing property not explicitly synthesized`| +------------------------------------------------------------------------------------------------------------------+ -Wobjc-missing-super-calls -------------------------- This diagnostic is enabled by default. **Diagnostic text:** +-------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`method possibly missing a \[super` |nbsp| :placeholder:`A`:diagtext:`\] call`| +-------------------------------------------------------------------------------------------------------------------+ -Wobjc-multiple-method-names ---------------------------- This diagnostic is enabled by default. **Diagnostic text:** +--------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`multiple methods named` |nbsp| :placeholder:`A` |nbsp| :diagtext:`found`| +--------------------------------------------------------------------------------------------------------------+ -Wobjc-noncopy-retain-block-property ------------------------------------ This diagnostic is enabled by default. **Diagnostic text:** +--------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`retain'ed block property does not copy the block - use copy attribute instead`| +--------------------------------------------------------------------------------------------------------------------+ -Wobjc-nonunified-exceptions ---------------------------- This diagnostic is enabled by default. **Diagnostic text:** +-----------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`cannot catch an exception thrown with @throw in C++ in the non-unified exception model`| +-----------------------------------------------------------------------------------------------------------------------------+ -Wobjc-property-implementation ------------------------------ This diagnostic is enabled by default. **Diagnostic text:** +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`class property` |nbsp| :placeholder:`A` |nbsp| :diagtext:`requires method` |nbsp| :placeholder:`B` |nbsp| :diagtext:`to be defined - use @dynamic or provide a method implementation in this class implementation`| +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`class property` |nbsp| :placeholder:`A` |nbsp| :diagtext:`requires method` |nbsp| :placeholder:`B` |nbsp| :diagtext:`to be defined - use @dynamic or provide a method implementation in this category`| +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`property` |nbsp| :placeholder:`A` |nbsp| :diagtext:`requires method` |nbsp| :placeholder:`B` |nbsp| :diagtext:`to be defined - use @synthesize, @dynamic or provide a method implementation in this class implementation`| +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`property` |nbsp| :placeholder:`A` |nbsp| :diagtext:`requires method` |nbsp| :placeholder:`B` |nbsp| :diagtext:`to be defined - use @dynamic or provide a method implementation in this category`| +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wobjc-property-implicit-mismatch --------------------------------- This diagnostic is enabled by default. **Diagnostic text:** +---------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`primary property declaration is implicitly strong while redeclaration in class extension is weak`| +---------------------------------------------------------------------------------------------------------------------------------------+ -Wobjc-property-matches-cocoa-ownership-rule -------------------------------------------- This diagnostic is enabled by default. **Diagnostic text:** +-------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`property follows Cocoa naming convention for returning 'owned' objects`| +-------------------------------------------------------------------------------------------------------------+ -Wobjc-property-no-attribute ---------------------------- This diagnostic is enabled by default. **Diagnostic text:** +-----------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`default property attribute 'assign' not appropriate for object`| +-----------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`no 'assign', 'retain', or 'copy' attribute is specified - 'assign' is assumed`| +--------------------------------------------------------------------------------------------------------------------+ -Wobjc-property-synthesis ------------------------- This diagnostic is enabled by default. **Diagnostic text:** +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`auto property synthesis will not synthesize property` |nbsp| :placeholder:`A`:diagtext:`; it will be implemented by its superclass, use @dynamic to acknowledge intention`| +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`auto property synthesis will not synthesize property` |nbsp| :placeholder:`A` |nbsp| :diagtext:`because it is 'readwrite' but it will be synthesized 'readonly' via another property`| +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`auto property synthesis will not synthesize property` |nbsp| :placeholder:`A` |nbsp| :diagtext:`because it cannot share an ivar with another synthesized property`| +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wobjc-protocol-method-implementation ------------------------------------- This diagnostic is enabled by default. **Diagnostic text:** +----------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`category is implementing a method which will also be implemented by its primary class`| +----------------------------------------------------------------------------------------------------------------------------+ -Wobjc-protocol-property-synthesis ---------------------------------- This diagnostic is enabled by default. **Diagnostic text:** +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`auto property synthesis will not synthesize property` |nbsp| :placeholder:`A` |nbsp| :diagtext:`declared in protocol` |nbsp| :placeholder:`B`| +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wobjc-protocol-qualifiers -------------------------- This diagnostic is enabled by default. **Diagnostic text:** +----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`parameterized class` |nbsp| :placeholder:`A` |nbsp| :diagtext:`already conforms to the protocols listed; did you forget a '\*'?`| +----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wobjc-readonly-with-setter-property ------------------------------------ This diagnostic is enabled by default. **Diagnostic text:** +-----------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`setter cannot be specified for a readonly property`| +-----------------------------------------------------------------------------------------+ -Wobjc-redundant-api-use ------------------------ Synonym for `-Wobjc-redundant-literal-use`_. -Wobjc-redundant-literal-use ---------------------------- This diagnostic is enabled by default. **Diagnostic text:** +-------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`using` |nbsp| :placeholder:`A` |nbsp| :diagtext:`with a literal is redundant`| +-------------------------------------------------------------------------------------------------------------------+ -Wobjc-root-class ----------------- This diagnostic is enabled by default. **Diagnostic text:** +-------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`class` |nbsp| :placeholder:`A` |nbsp| :diagtext:`defined without specifying a base class`| +-------------------------------------------------------------------------------------------------------------------------------+ -Wobjc-string-compare --------------------- This diagnostic is enabled by default. **Diagnostic text:** +---------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`direct comparison of a string literal has undefined behavior`| +---------------------------------------------------------------------------------------------------+ -Wobjc-string-concatenation --------------------------- This diagnostic is enabled by default. **Diagnostic text:** +-------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`concatenated NSString literal for an NSArray expression - possibly missing a comma`| +-------------------------------------------------------------------------------------------------------------------------+ -Wobjc-unsafe-perform-selector ------------------------------ This diagnostic is enabled by default. **Diagnostic text:** +-------------------------------------------------------------------------------------------------------------------+--------------------+------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is incompatible with selectors that return a` |nbsp| |+------------------+| |nbsp| :diagtext:`type`| | ||:diagtext:`struct`|| | | |+------------------+| | | ||:diagtext:`union` || | | |+------------------+| | | ||:diagtext:`vector`|| | | |+------------------+| | +-------------------------------------------------------------------------------------------------------------------+--------------------+------------------------+ -Wodr ----- This diagnostic is enabled by default. **Diagnostic text:** +--------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`type` |nbsp| :placeholder:`A` |nbsp| :diagtext:`has incompatible definitions in different translation units`| +--------------------------------------------------------------------------------------------------------------------------------------------------+ -Wold-style-cast ---------------- **Diagnostic text:** +------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`use of old-style cast`| +------------------------------------------------------------+ -Wold-style-definition ---------------------- This diagnostic flag exists for GCC compatibility, and has no effect in Clang. -Wopencl-unsupported-rgba ------------------------- This diagnostic is enabled by default. **Diagnostic text:** +----------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`vector component name '`:placeholder:`A`:diagtext:`' is an OpenCL version 2.2 feature`| +----------------------------------------------------------------------------------------------------------------------------+ -Wopenmp-clauses ---------------- This diagnostic is enabled by default. **Diagnostic text:** +-------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`aligned clause will be ignored because the requested alignment is not a power of 2`| +-------------------------------------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------+---------------------------------------------------+-------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`zero linear step (`:placeholder:`A` |nbsp| |+-------------------------------------------------+|:diagtext:`should probably be const)`| | || || | | |+-------------------------------------------------+| | | ||:diagtext:`and other variables in clause` |nbsp| || | | |+-------------------------------------------------+| | +---------------------------------------------------------------------------------+---------------------------------------------------+-------------------------------------+ -Wopenmp-loop-form ------------------ This diagnostic is enabled by default. **Diagnostic text:** +-----------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')`| +-----------------------------------------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`OpenMP loop iteration variable cannot have more than 64 bits size and will be narrowed`| +-----------------------------------------------------------------------------------------------------------------------------+ -Wopenmp-target --------------- This diagnostic is enabled by default. **Diagnostic text:** +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`The OpenMP offloading target '`:placeholder:`A`:diagtext:`' is similar to target '`:placeholder:`B`:diagtext:`' already specified - will be ignored.`| +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ ++-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`No library '`:placeholder:`A`:diagtext:`' found in the default clang lib directory or in LIBRARY\_PATH. Expect degraded performance due to no inlining of runtime functions on target devices.`| ++-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + ++----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`Non-trivial type` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is mapped, only trivial types are guaranteed to be mapped correctly`| ++----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +-----------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`declaration is not declared in any declare target region`| +-----------------------------------------------------------------------------------------------+ -Woption-ignored ---------------- This diagnostic is enabled by default. **Diagnostic text:** +------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`option '-ffine-grained-bitfield-accesses' cannot be enabled together with a sanitizer; flag ignored`| +------------------------------------------------------------------------------------------------------------------------------------------+ ++-------------------------------------------------------------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`The '`:placeholder:`A`:diagtext:`' architecture does not support -moutline; flag ignored`| ++-------------------------------------------------------------------------------------------------------------------------------+ + +----------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`option '`:placeholder:`A`:diagtext:`' was ignored by the PS4 toolchain, using '-fPIC'`| +----------------------------------------------------------------------------------------------------------------------------+ -+-------------------------------------------------------------------------------------------------------------------------------------------+ -|:warning:`warning:` |nbsp| :diagtext:`ignoring '-mabicalls' option as it cannot be used with non position-independent code and the N64 ABI`| -+-------------------------------------------------------------------------------------------------------------------------------------------+ - +-------------------------------------------------------------------------------------------------------------------+-------------------------------------------+----------------------+ |:warning:`warning:` |nbsp| :diagtext:`ignoring '-mlong-calls' option as it is not currently supported with` |nbsp| |+-----------------------------------------+|:diagtext:`-mabicalls`| | || || | | |+-----------------------------------------+| | | ||:diagtext:`the implicit usage of` |nbsp| || | | |+-----------------------------------------+| | +-------------------------------------------------------------------------------------------------------------------+-------------------------------------------+----------------------+ ++-----------------------------------------------------------------------------------------------------------------------+-------------------------------+----------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`ignoring '`:placeholder:`A`:diagtext:`' option as it cannot be used with` |nbsp| |+-----------------------------+| |nbsp| :diagtext:`-mabicalls and the N64 ABI`| +| ||:diagtext:`implicit usage of`|| | +| |+-----------------------------+| | +| || || | +| |+-----------------------------+| | ++-----------------------------------------------------------------------------------------------------------------------+-------------------------------+----------------------------------------------+ ++----------------------------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`auto-vectorization requires HVX, use -mhvx to enable it`| ++----------------------------------------------------------------------------------------------+ + + +-Wordered-compare-function-pointers +----------------------------------- +This diagnostic is enabled by default. + +**Diagnostic text:** + ++------------------------------------------------------------------------------------------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`ordered comparison of function pointers (`:placeholder:`A` |nbsp| :diagtext:`and` |nbsp| :placeholder:`B`:diagtext:`)`| ++------------------------------------------------------------------------------------------------------------------------------------------------------------+ + + -Wout-of-line-declaration ------------------------- This diagnostic is an error by default, but the flag ``-Wno-out-of-line-declaration`` can be used to disable the error. **Diagnostic text:** +-------------------------------------------------------------------------------------------+ |:error:`error:` |nbsp| :diagtext:`out-of-line declaration of a member must be a definition`| +-------------------------------------------------------------------------------------------+ -Wout-of-scope-function ----------------------- This diagnostic is enabled by default. **Diagnostic text:** +-------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`use of out-of-scope declaration of` |nbsp| :placeholder:`A`|+-------------------------------------------------------------------------------------+| | || || | |+-------------------------------------------------------------------------------------+| | || |nbsp| :diagtext:`whose type is not compatible with that of an implicit declaration`|| | |+-------------------------------------------------------------------------------------+| +-------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------+ -Wover-aligned -------------- **Diagnostic text:** +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`type` |nbsp| :placeholder:`A` |nbsp| :diagtext:`requires` |nbsp| :placeholder:`B` |nbsp| :diagtext:`bytes of alignment and the default allocator only guarantees` |nbsp| :placeholder:`C` |nbsp| :diagtext:`bytes`| +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Woverflow ---------- This diagnostic flag exists for GCC compatibility, and has no effect in Clang. -Woverlength-strings -------------------- **Diagnostic text:** +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------+-----------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`string literal of length` |nbsp| :placeholder:`A` |nbsp| :diagtext:`exceeds maximum length` |nbsp| :placeholder:`B` |nbsp| :diagtext:`that` |nbsp| |+-------------------+| |nbsp| :diagtext:`compilers are required to support`| | ||:diagtext:`C90` || | | |+-------------------+| | | ||:diagtext:`ISO C99`|| | | |+-------------------+| | | ||:diagtext:`C++` || | | |+-------------------+| | +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------+-----------------------------------------------------+ -Woverloaded-shift-op-parentheses --------------------------------- This diagnostic is enabled by default. **Diagnostic text:** +------------------------------------------------------------------+----------------+------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`overloaded operator` |nbsp| |+--------------+| |nbsp| :diagtext:`has higher precedence than comparison operator`| | ||:diagtext:`>>`|| | | |+--------------+| | | ||:diagtext:`<<`|| | | |+--------------+| | +------------------------------------------------------------------+----------------+------------------------------------------------------------------+ -Woverloaded-virtual -------------------- **Diagnostic text:** +-----------------------------------------------------------------------------------------------+-----------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`hides overloaded virtual` |nbsp| |+---------------------+| | ||:diagtext:`function` || | |+---------------------+| | ||:diagtext:`functions`|| | |+---------------------+| +-----------------------------------------------------------------------------------------------+-----------------------+ -Woverride-module ----------------- This diagnostic is enabled by default. **Diagnostic text:** +-------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`overriding the module target triple with` |nbsp| :placeholder:`A`| +-------------------------------------------------------------------------------------------------------+ -Woverriding-method-mismatch ---------------------------- **Diagnostic text:** +-------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`conflicting distributed object modifiers on parameter type in declaration of` |nbsp| :placeholder:`A`| +-------------------------------------------------------------------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`conflicting parameter types in declaration of` |nbsp| :placeholder:`A`| +------------------------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`conflicting distributed object modifiers on return type in declaration of` |nbsp| :placeholder:`A`| +----------------------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`conflicting return type in declaration of` |nbsp| :placeholder:`A`| +--------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`conflicting variadic declaration of method and its implementation`| +--------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`conflicting parameter types in declaration of` |nbsp| :placeholder:`A`:diagtext:`:` |nbsp| :placeholder:`B` |nbsp| :diagtext:`vs` |nbsp| :placeholder:`C`| +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`conflicting return type in declaration of` |nbsp| :placeholder:`A`:diagtext:`:` |nbsp| :placeholder:`B` |nbsp| :diagtext:`vs` |nbsp| :placeholder:`C`| +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Woverriding-t-option --------------------- This diagnostic is enabled by default. **Diagnostic text:** +---------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`overriding '`:placeholder:`A`:diagtext:`' option with '`:placeholder:`B`:diagtext:`'`| +---------------------------------------------------------------------------------------------------------------------------+ -Wpacked -------- **Diagnostic text:** +--------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`packed attribute is unnecessary for` |nbsp| :placeholder:`A`| +--------------------------------------------------------------------------------------------------+ -Wpadded -------- **Diagnostic text:** +------------------------------------------------------+-----------------------+--------------------------------------------------------------------------------+------------------+---------------+------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`padding` |nbsp| |+---------------------+| |nbsp| :placeholder:`B` |nbsp| :diagtext:`with` |nbsp| :placeholder:`C` |nbsp| |+----------------+|+-------------+| |nbsp| :diagtext:`to align anonymous bit-field`| | ||:diagtext:`struct` || ||:diagtext:`byte`||| || | | |+---------------------+| |+----------------+|+-------------+| | | ||:diagtext:`interface`|| ||:diagtext:`bit` |||:diagtext:`s`|| | | |+---------------------+| |+----------------+|+-------------+| | | ||:diagtext:`class` || | | | | | |+---------------------+| | | | | +------------------------------------------------------+-----------------------+--------------------------------------------------------------------------------+------------------+---------------+------------------------------------------------+ +------------------------------------------------------+-----------------------+--------------------------------------------------------------------------------+------------------+---------------+----------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`padding` |nbsp| |+---------------------+| |nbsp| :placeholder:`B` |nbsp| :diagtext:`with` |nbsp| :placeholder:`C` |nbsp| |+----------------+|+-------------+| |nbsp| :diagtext:`to align` |nbsp| :placeholder:`E`| | ||:diagtext:`struct` || ||:diagtext:`byte`||| || | | |+---------------------+| |+----------------+|+-------------+| | | ||:diagtext:`interface`|| ||:diagtext:`bit` |||:diagtext:`s`|| | | |+---------------------+| |+----------------+|+-------------+| | | ||:diagtext:`class` || | | | | | |+---------------------+| | | | | +------------------------------------------------------+-----------------------+--------------------------------------------------------------------------------+------------------+---------------+----------------------------------------------------+ +--------------------------------------------------------------------------------------------------------------------------------------+------------------+---------------+-----------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`padding size of` |nbsp| :placeholder:`A` |nbsp| :diagtext:`with` |nbsp| :placeholder:`B` |nbsp| |+----------------+|+-------------+| |nbsp| :diagtext:`to alignment boundary`| | ||:diagtext:`byte`||| || | | |+----------------+|+-------------+| | | ||:diagtext:`bit` |||:diagtext:`s`|| | | |+----------------+|+-------------+| | +--------------------------------------------------------------------------------------------------------------------------------------+------------------+---------------+-----------------------------------------+ -Wparentheses ------------- This diagnostic is enabled by default. Also controls `-Wbitwise-op-parentheses`_, `-Wdangling-else`_, `-Wlogical-not-parentheses`_, `-Wlogical-op-parentheses`_, `-Woverloaded-shift-op-parentheses`_, `-Wparentheses-equality`_, `-Wshift-op-parentheses`_. **Diagnostic text:** +-----------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`using the result of an assignment as a condition without parentheses`| +-----------------------------------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`has lower precedence than` |nbsp| :placeholder:`B`:diagtext:`;` |nbsp| :placeholder:`B` |nbsp| :diagtext:`will be evaluated first`| +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`operator '?:' has lower precedence than '`:placeholder:`A`:diagtext:`'; '`:placeholder:`A`:diagtext:`' will be evaluated first`| +---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wparentheses-equality ---------------------- This diagnostic is enabled by default. **Diagnostic text:** +--------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`equality comparison with extraneous parentheses`| +--------------------------------------------------------------------------------------+ -Wpartial-availability ---------------------- Synonym for `-Wunguarded-availability`_. -Rpass ------ **Diagnostic text:** The text of this diagnostic is not controlled by Clang. -Rpass-analysis --------------- **Diagnostic text:** The text of this diagnostic is not controlled by Clang. +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:remark:`remark:` |nbsp| :placeholder:`A`:diagtext:`; allow reordering by specifying '#pragma clang loop vectorize(enable)' before the loop. If the arrays will always be independent specify '#pragma clang loop vectorize(assume\_safety)' before the loop or provide the '\_\_restrict\_\_' qualifier with the independent array arguments. Erroneous results will occur if these options are incorrectly applied!`| +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:remark:`remark:` |nbsp| :placeholder:`A`:diagtext:`; allow reordering by specifying '#pragma clang loop vectorize(enable)' before the loop or by providing the compiler option '-ffast-math'.`| +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wpass-failed ------------- This diagnostic is enabled by default. **Diagnostic text:** The text of this diagnostic is not controlled by Clang. -Rpass-missed ------------- **Diagnostic text:** The text of this diagnostic is not controlled by Clang. -Wpch-date-time --------------- This diagnostic is enabled by default. **Diagnostic text:** +---------------------------+--------------------------------+-----------------------------------------------------+ |:warning:`warning:` |nbsp| |+------------------------------+| |nbsp| :diagtext:`uses \_\_DATE\_\_ or \_\_TIME\_\_`| | ||:diagtext:`precompiled header`|| | | |+------------------------------+| | | ||:diagtext:`module` || | | |+------------------------------+| | +---------------------------+--------------------------------+-----------------------------------------------------+ -Wpedantic ---------- -Also controls `-Wc++11-extra-semi`_, `-Wc++11-long-long`_, `-Wc++14-binary-literal`_, `-Wc11-extensions`_, `-Wcomplex-component-init`_, `-Wdeclaration-after-statement`_, `-Wdollar-in-identifier-extension`_, `-Wembedded-directive`_, `-Wempty-translation-unit`_, `-Wextended-offsetof`_, `-Wflexible-array-extensions`_, `-Wformat-pedantic`_, `-Wfour-char-constants`_, `-Wgnu-anonymous-struct`_, `-Wgnu-auto-type`_, `-Wgnu-binary-literal`_, `-Wgnu-case-range`_, `-Wgnu-complex-integer`_, `-Wgnu-compound-literal-initializer`_, `-Wgnu-conditional-omitted-operand`_, `-Wgnu-empty-initializer`_, `-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-redeclared-enum`_, `-Wgnu-statement-expression`_, `-Wgnu-union-cast`_, `-Wgnu-zero-line-directive`_, `-Wgnu-zero-variadic-macro-arguments`_, `-Wimport-preprocessor-directive-pedantic`_, `-Wkeyword-macro`_, `-Wlanguage-extension-token`_, `-Wlong-long`_, `-Wmicrosoft-charize`_, `-Wmicrosoft-comment-paste`_, `-Wmicrosoft-cpp-macro`_, `-Wmicrosoft-end-of-file`_, `-Wmicrosoft-enum-value`_, `-Wmicrosoft-fixed-enum`_, `-Wmicrosoft-flexible-array`_, `-Wmicrosoft-redeclare-static`_, `-Wnested-anon-types`_, `-Wnullability-extension`_, `-Woverlength-strings`_, `-Wretained-language-linkage`_, `-Wundefined-internal-type`_, `-Wvla-extension`_, `-Wzero-length-array`_. +Also controls `-Wc++11-extra-semi`_, `-Wc++11-long-long`_, `-Wc++14-binary-literal`_, `-Wc11-extensions`_, `-Wcomplex-component-init`_, `-Wdeclaration-after-statement`_, `-Wdollar-in-identifier-extension`_, `-Wembedded-directive`_, `-Wempty-translation-unit`_, `-Wflexible-array-extensions`_, `-Wfour-char-constants`_, `-Wgnu-anonymous-struct`_, `-Wgnu-auto-type`_, `-Wgnu-binary-literal`_, `-Wgnu-case-range`_, `-Wgnu-complex-integer`_, `-Wgnu-compound-literal-initializer`_, `-Wgnu-conditional-omitted-operand`_, `-Wgnu-empty-initializer`_, `-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-redeclared-enum`_, `-Wgnu-statement-expression`_, `-Wgnu-union-cast`_, `-Wgnu-zero-line-directive`_, `-Wgnu-zero-variadic-macro-arguments`_, `-Wimport-preprocessor-directive-pedantic`_, `-Wkeyword-macro`_, `-Wlanguage-extension-token`_, `-Wlong-long`_, `-Wmicrosoft-charize`_, `-Wmicrosoft-comment-paste`_, `-Wmicrosoft-cpp-macro`_, `-Wmicrosoft-end-of-file`_, `-Wmicrosoft-enum-value`_, `-Wmicrosoft-fixed-enum`_, `-Wmicrosoft-flexible-array`_, `-Wmicrosoft-redeclare-static`_, `-Wnested-anon-types`_, `-Wnullability-extension`_, `-Woverlength-strings`_, `-Wretained-language-linkage`_, `-Wundefined-internal-type`_, `-Wvla-extension`_, `-Wzero-length-array`_. **Diagnostic text:** +------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'enable\_if' is a clang extension`| +------------------------------------------------------------------------+ +--------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'diagnose\_if' is a clang extension`| +--------------------------------------------------------------------------+ +--------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`designated initializers are a C99 feature`| +--------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`ISO C++ does not allow 'main' to be used by a program`| +--------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------+ |:warning:`warning:` |nbsp| :diagtext:`C++98 requires an accessible copy constructor for class` |nbsp| :placeholder:`C` |nbsp| :diagtext:`when binding a reference to a temporary; was` |nbsp| |+---------------------+| | ||:diagtext:`private` || | |+---------------------+| | ||:diagtext:`protected`|| | |+---------------------+| +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------+ +--------------------------------------------------------+--------------------+------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`anonymous` |nbsp| |+------------------+| |nbsp| :diagtext:`cannot be '`:placeholder:`B`:diagtext:`'`| | ||:diagtext:`struct`|| | | |+------------------+| | | ||:diagtext:`union` || | | |+------------------+| | +--------------------------------------------------------+--------------------+------------------------------------------------------------+ -+--------------------------------------------------------------------+-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------+ -|:warning:`warning:` |nbsp| :diagtext:`no viable constructor` |nbsp| |+---------------------------------------+| |nbsp| :diagtext:`of type` |nbsp| :placeholder:`B`:diagtext:`; C++98 requires a copy constructor when binding a reference to a temporary`| -| ||:diagtext:`copying variable` || | -| |+---------------------------------------+| | -| ||:diagtext:`copying parameter` || | -| |+---------------------------------------+| | -| ||:diagtext:`returning object` || | -| |+---------------------------------------+| | -| ||:diagtext:`throwing object` || | -| |+---------------------------------------+| | -| ||:diagtext:`copying member subobject` || | -| |+---------------------------------------+| | -| ||:diagtext:`copying array element` || | -| |+---------------------------------------+| | -| ||:diagtext:`allocating object` || | -| |+---------------------------------------+| | -| ||:diagtext:`copying temporary` || | -| |+---------------------------------------+| | -| ||:diagtext:`initializing base subobject`|| | -| |+---------------------------------------+| | -| ||:diagtext:`initializing vector element`|| | -| |+---------------------------------------+| | -| ||:diagtext:`capturing value` || | -| |+---------------------------------------+| | -+--------------------------------------------------------------------+-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------+ ++--------------------------------------------------------------------+------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`no viable constructor` |nbsp| |+----------------------------------------------------+| |nbsp| :diagtext:`of type` |nbsp| :placeholder:`B`:diagtext:`; C++98 requires a copy constructor when binding a reference to a temporary`| +| ||:diagtext:`copying variable` || | +| |+----------------------------------------------------+| | +| ||:diagtext:`copying parameter` || | +| |+----------------------------------------------------+| | +| ||:diagtext:`returning object` || | +| |+----------------------------------------------------+| | +| ||:diagtext:`initializing statement expression result`|| | +| |+----------------------------------------------------+| | +| ||:diagtext:`throwing object` || | +| |+----------------------------------------------------+| | +| ||:diagtext:`copying member subobject` || | +| |+----------------------------------------------------+| | +| ||:diagtext:`copying array element` || | +| |+----------------------------------------------------+| | +| ||:diagtext:`allocating object` || | +| |+----------------------------------------------------+| | +| ||:diagtext:`copying temporary` || | +| |+----------------------------------------------------+| | +| ||:diagtext:`initializing base subobject` || | +| |+----------------------------------------------------+| | +| ||:diagtext:`initializing vector element` || | +| |+----------------------------------------------------+| | +| ||:diagtext:`capturing value` || | +| |+----------------------------------------------------+| | ++--------------------------------------------------------------------+------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------+ ++--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`ISO C++ standards before C++17 do not allow new expression for type` |nbsp| :placeholder:`A` |nbsp| :diagtext:`to use list-initialization`| ++--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +--------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`parameter` |nbsp| :placeholder:`A` |nbsp| :diagtext:`was not declared, defaulting to type 'int'`| +--------------------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`invoking a pointer to a 'const &' member function on an rvalue is a C++2a extension`| +--------------------------------------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`qualifier in explicit instantiation of` |nbsp| :placeholder:`A` |nbsp| :diagtext:`requires a template-id (a typedef is not permitted)`| +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------+----------------------+-----------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`static` |nbsp| |+--------------------+| |nbsp| :placeholder:`B` |nbsp| :diagtext:`is used in an inline function with external linkage`| | ||:diagtext:`function`|| | | |+--------------------+| | | ||:diagtext:`variable`|| | | |+--------------------+| | +-----------------------------------------------------+----------------------+-----------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`ISO C forbids forward references to 'enum' types`| +---------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------------------------------------------------+-------------------+-------------+ |:warning:`warning:` |nbsp| :diagtext:`ISO C restricts enumerator values to range of 'int' (`:placeholder:`A` |nbsp| :diagtext:`is too` |nbsp| |+-----------------+|:diagtext:`)`| | ||:diagtext:`small`|| | | |+-----------------+| | | ||:diagtext:`large`|| | | |+-----------------+| | +----------------------------------------------------------------------------------------------------------------------------------------------+-------------------+-------------+ +--------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`size of static array must be an integer constant expression`| +--------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`initializer for aggregate is not a compile-time constant`| +-----------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`flexible array members are a C99 feature`| +-------------------------------------------------------------------------------+ +---------------------------------------------------------------+-----------------------+--------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`invalid application of '`|+---------------------+|:diagtext:`' to a function type`| | ||:diagtext:`sizeof` || | | |+---------------------+| | | ||:diagtext:`alignof` || | | |+---------------------+| | | ||:diagtext:`vec\_step`|| | | |+---------------------+| | +---------------------------------------------------------------+-----------------------+--------------------------------+ +---------------------------------------------------------------+-----------------------+----------------------------+ |:warning:`warning:` |nbsp| :diagtext:`invalid application of '`|+---------------------+|:diagtext:`' to a void type`| | ||:diagtext:`sizeof` || | | |+---------------------+| | | ||:diagtext:`alignof` || | | |+---------------------+| | | ||:diagtext:`vec\_step`|| | | |+---------------------+| | +---------------------------------------------------------------+-----------------------+----------------------------+ +-------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`ISO C90 does not allow subscripting non-lvalue array`| +-------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`subscript of a pointer to void is a GNU extension`| +----------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`ISO C forbids taking the address of an expression of type 'void'`| +-------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`ordered comparison between pointer and zero (`:placeholder:`A` |nbsp| :diagtext:`and` |nbsp| :placeholder:`B`:diagtext:`) is an extension`| +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`equality comparison between function pointer and void pointer (`:placeholder:`A` |nbsp| :diagtext:`and` |nbsp| :placeholder:`B`:diagtext:`)`| +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +----------------------------------------------------+-----------------------+---------------------------+---------------+----------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`arithmetic on`|+---------------------+| |nbsp| :diagtext:`pointer`|+-------------+| |nbsp| :diagtext:`to void is a GNU extension`| | || |nbsp| :diagtext:`a`|| || || | | |+---------------------+| |+-------------+| | | || || ||:diagtext:`s`|| | | |+---------------------+| |+-------------+| | +----------------------------------------------------+-----------------------+---------------------------+---------------+----------------------------------------------+ +----------------------------------------------------+-----------------------+---------------------------+---------------+----------------------+-------------------------+---------------------------------+---------------+------------------------+---------------------------------------------------+--------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`arithmetic on`|+---------------------+| |nbsp| :diagtext:`pointer`|+-------------+| |nbsp| :diagtext:`to`|+-----------------------+| |nbsp| :diagtext:`function type`|+-------------+| |nbsp| :placeholder:`B`|+-------------------------------------------------+| |nbsp| :diagtext:`is a GNU extension`| | || |nbsp| :diagtext:`a`|| || || || |nbsp| :diagtext:`the`|| || || || || | | |+---------------------+| |+-------------+| |+-----------------------+| |+-------------+| |+-------------------------------------------------+| | | || || ||:diagtext:`s`|| || || ||:diagtext:`s`|| ||+-----------------------------------------------+|| | | |+---------------------+| |+-------------+| |+-----------------------+| |+-------------+| ||| |nbsp| :diagtext:`and` |nbsp| :placeholder:`D`||| | | | | | | | | | | ||+-----------------------------------------------+|| | | | | | | | | | | |+-------------------------------------------------+| | +----------------------------------------------------+-----------------------+---------------------------+---------------+----------------------+-------------------------+---------------------------------+---------------+------------------------+---------------------------------------------------+--------------------------------------+ +-----------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`ISO C does not support '++'/'--' on complex integer type` |nbsp| :placeholder:`A`| +-----------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`ISO C does not support '~' for complex conjugation of` |nbsp| :placeholder:`A`| +--------------------------------------------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`complex numbers are an extension in a freestanding C99 implementation`| +------------------------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`cast between pointer-to-function and pointer-to-object is an extension`| +-------------------------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------+----------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`implicit conversion from array size expression of type` |nbsp| :placeholder:`A` |nbsp| :diagtext:`to` |nbsp| |+-----------------------+| |nbsp| :diagtext:`type` |nbsp| :placeholder:`C` |nbsp| :diagtext:`is a C++11 extension`| | ||:diagtext:`integral` || | | |+-----------------------+| | | ||:diagtext:`enumeration`|| | | |+-----------------------+| | +---------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------+----------------------------------------------------------------------------------------+ +---------------------------+----------------------------------------------------------------+----------------------------------------------------------------------+ |:warning:`warning:` |nbsp| |+--------------------------------------------------------------+| |nbsp| :diagtext:`converts between void pointer and function pointer`| | ||:diagtext:`assigning to different types` || | | |+--------------------------------------------------------------+| | | ||:diagtext:`passing to parameter of different type` || | | |+--------------------------------------------------------------+| | | ||:diagtext:`returning from function with different return type`|| | | |+--------------------------------------------------------------+| | | ||:diagtext:`converting between types` || | | |+--------------------------------------------------------------+| | | ||:diagtext:`initializing with expression of different type` || | | |+--------------------------------------------------------------+| | | ||:diagtext:`sending to parameter of different type` || | | |+--------------------------------------------------------------+| | | ||:diagtext:`casting between types` || | | |+--------------------------------------------------------------+| | +---------------------------+----------------------------------------------------------------+----------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`kernel function` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is a member function; this may not be accepted by nvcc`| +--------------------------------------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`C99 forbids conditional expressions with only one void side`| +--------------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`C99 forbids casting nonscalar type` |nbsp| :placeholder:`A` |nbsp| :diagtext:`to the same type`| +-------------------------------------------------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`use of the` |nbsp| :placeholder:`A` |nbsp| :diagtext:`attribute is a C++14 extension`| +---------------------------------------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`use of the` |nbsp| :placeholder:`A` |nbsp| :diagtext:`attribute is a C++17 extension`| +---------------------------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------+--------------------+---------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`types declared in an anonymous` |nbsp| |+------------------+| |nbsp| :diagtext:`are a Microsoft extension`| | ||:diagtext:`struct`|| | | |+------------------+| | | ||:diagtext:`union` || | | |+------------------+| | +-----------------------------------------------------------------------------+--------------------+---------------------------------------------+ ++------------------------------------------------------------------------------------------------------------------------------------+-----------------------------+------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`format specifies type` |nbsp| :placeholder:`A` |nbsp| :diagtext:`but the argument has` |nbsp| |+---------------------------+| |nbsp| :placeholder:`B`| +| ||:diagtext:`type` || | +| |+---------------------------+| | +| ||:diagtext:`underlying type`|| | +| |+---------------------------+| | ++------------------------------------------------------------------------------------------------------------------------------------+-----------------------------+------------------------+ + +---------------------------------------------------+----------------------+-----------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`void` |nbsp| |+--------------------+| |nbsp| :placeholder:`A` |nbsp| :diagtext:`should not return void expression`| | ||:diagtext:`function`|| | | |+--------------------+| | | ||:diagtext:`method` || | | |+--------------------+| | | ||:diagtext:`block` || | | |+--------------------+| | +---------------------------------------------------+----------------------+-----------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'`:placeholder:`A`:diagtext:`' cannot be signed or unsigned`| +--------------------------------------------------------------------------------------------------+ +---------------------------+----------------------------------+------------------------------+-----------------------+----------------------------+ |:warning:`warning:` |nbsp| |+--------------------------------+|:diagtext:`array size` |nbsp| |+---------------------+|:diagtext:`is a C99 feature`| | ||:diagtext:`qualifier in` |nbsp| || || || | | |+--------------------------------+| |+---------------------+| | | ||:diagtext:`static` |nbsp| || || || | | |+--------------------------------+| |+---------------------+| | | || || ||:diagtext:`'\[\*\] '`|| | | |+--------------------------------+| |+---------------------+| | +---------------------------+----------------------------------+------------------------------+-----------------------+----------------------------+ +--------------------------------------------------------+------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`extra ';'` |nbsp| |+----------------------------------------------+| | ||:diagtext:`outside of a function` || | |+----------------------------------------------+| | ||+--------------------------------------------+|| | |||:diagtext:`inside a` |nbsp| :placeholder:`B`||| | ||+--------------------------------------------+|| | |+----------------------------------------------+| | ||:diagtext:`inside instance variable list` || | |+----------------------------------------------+| | ||:diagtext:`after member function definition` || | |+----------------------------------------------+| +--------------------------------------------------------+------------------------------------------------+ +-----------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'\_\_thread' before '`:placeholder:`A`:diagtext:`'`| +-----------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`type-less parameter names in function declaration`| +----------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`variable declaration in for loop is a C99-specific feature`| +-------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`compound literals are a C99-specific feature`| +-----------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`commas at the end of enumerator lists are a C99-specific feature`| +-------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`commas at the end of enumerator lists are a C++11 extension`| +--------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`enumeration types with a fixed underlying type are a C++11 extension`| +-----------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`use of GNU array range extension`| +-----------------------------------------------------------------------+ +------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`exception specification of '...' is a Microsoft extension`| +------------------------------------------------------------------------------------------------+ +------------------------------------------------------------+---------------------------+-----------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`attributes on` |nbsp| |+-------------------------+| |nbsp| :diagtext:`declaration are a C++17 extension`| | ||:diagtext:`a namespace` || | | |+-------------------------+| | | ||:diagtext:`an enumerator`|| | | |+-------------------------+| | +------------------------------------------------------------+---------------------------+-----------------------------------------------------+ +-----------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`extern templates are a C++11 extension`| +-----------------------------------------------------------------------------+ +------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`multi-line // comment`| +------------------------------------------------------------+ +-----------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`// comments are not allowed in this language`| +-----------------------------------------------------------------------------------+ +----------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`no newline at end of file`| +----------------------------------------------------------------+ +------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`use of non-standard escape character '\\`:placeholder:`A`:diagtext:`'`| +------------------------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`hexadecimal floating constants are a C99 feature`| +---------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`hexadecimal floating literals are a C++17 feature`| +----------------------------------------------------------------------------------------+ +---------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`#ident is a language extension`| +---------------------------------------------------------------------+ +-----------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`#warning is a language extension`| +-----------------------------------------------------------------------+ +-----------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`comma operator in operand of #if`| +-----------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`\_\_VA\_ARGS\_\_ can only appear in the expansion of a C99 variadic macro`| +----------------------------------------------------------------------------------------------------------------+ +------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`variadic macros are a C99 feature`| +------------------------------------------------------------------------+ +--------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`named variadic macros are a GNU extension`| +--------------------------------------------------------------------------------+ +------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`empty macro arguments are a C99 feature`| +------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`C requires #line number to be less than` |nbsp| :placeholder:`A`:diagtext:`, allowed as extension`| +----------------------------------------------------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`macro expansion producing 'defined' has undefined behavior`| +-------------------------------------------------------------------------------------------------+ -Wpedantic-core-features ------------------------ **Diagnostic text:** +----------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`OpenCL extension` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is core feature or supported optional core feature - ignoring`| +----------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wpessimizing-move ------------------ **Diagnostic text:** +--------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`moving a temporary object prevents copy elision`| +--------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`moving a local object in a return statement prevents copy elision`| +--------------------------------------------------------------------------------------------------------+ -Wpointer-arith --------------- Some of the diagnostics controlled by this flag are enabled by default. **Diagnostic text:** +----------------------------------------------------+-----------------------+---------------------------+---------------+----------------------+-------------------------+---------------------------------+---------------+------------------------+---------------------------------------------------+--------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`arithmetic on`|+---------------------+| |nbsp| :diagtext:`pointer`|+-------------+| |nbsp| :diagtext:`to`|+-----------------------+| |nbsp| :diagtext:`function type`|+-------------+| |nbsp| :placeholder:`B`|+-------------------------------------------------+| |nbsp| :diagtext:`is a GNU extension`| | || |nbsp| :diagtext:`a`|| || || || |nbsp| :diagtext:`the`|| || || || || | | |+---------------------+| |+-------------+| |+-----------------------+| |+-------------+| |+-------------------------------------------------+| | | || || ||:diagtext:`s`|| || || ||:diagtext:`s`|| ||+-----------------------------------------------+|| | | |+---------------------+| |+-------------+| |+-----------------------+| |+-------------+| ||| |nbsp| :diagtext:`and` |nbsp| :placeholder:`D`||| | | | | | | | | | | ||+-----------------------------------------------+|| | | | | | | | | | | |+-------------------------------------------------+| | +----------------------------------------------------+-----------------------+---------------------------+---------------+----------------------+-------------------------+---------------------------------+---------------+------------------------+---------------------------------------------------+--------------------------------------+ +----------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`subscript of a pointer to void is a GNU extension`| +----------------------------------------------------------------------------------------+ +----------------------------------------------------+-----------------------+---------------------------+---------------+----------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`arithmetic on`|+---------------------+| |nbsp| :diagtext:`pointer`|+-------------+| |nbsp| :diagtext:`to void is a GNU extension`| | || |nbsp| :diagtext:`a`|| || || | | |+---------------------+| |+-------------+| | | || || ||:diagtext:`s`|| | | |+---------------------+| |+-------------+| | +----------------------------------------------------+-----------------------+---------------------------+---------------+----------------------------------------------+ +---------------------------------------------------------------+-----------------------+--------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`invalid application of '`|+---------------------+|:diagtext:`' to a function type`| | ||:diagtext:`sizeof` || | | |+---------------------+| | | ||:diagtext:`alignof` || | | |+---------------------+| | | ||:diagtext:`vec\_step`|| | | |+---------------------+| | +---------------------------------------------------------------+-----------------------+--------------------------------+ +---------------------------------------------------------------+-----------------------+----------------------------+ |:warning:`warning:` |nbsp| :diagtext:`invalid application of '`|+---------------------+|:diagtext:`' to a void type`| | ||:diagtext:`sizeof` || | | |+---------------------+| | | ||:diagtext:`alignof` || | | |+---------------------+| | | ||:diagtext:`vec\_step`|| | | |+---------------------+| | +---------------------------------------------------------------+-----------------------+----------------------------+ +-----------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`subtraction of pointers to type` |nbsp| :placeholder:`A` |nbsp| :diagtext:`of zero size has undefined behavior`| +-----------------------------------------------------------------------------------------------------------------------------------------------------+ -Wpointer-bool-conversion ------------------------- This diagnostic is enabled by default. **Diagnostic text:** +------------------------------------------------------+---------------------------+---------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`nonnull` |nbsp| |+-------------------------+| |nbsp| :diagtext:`'`:placeholder:`B`:diagtext:`' will evaluate to 'true' on first encounter`| | ||:diagtext:`function call`|| | | |+-------------------------+| | | ||:diagtext:`parameter` || | | |+-------------------------+| | +------------------------------------------------------+---------------------------+---------------------------------------------------------------------------------------------+ +-------------------------------------------------+------------------------------+---------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`address of`|+----------------------------+| |nbsp| :diagtext:`'`:placeholder:`B`:diagtext:`' will always evaluate to 'true'`| | || || | | |+----------------------------+| | | || |nbsp| :diagtext:`function`|| | | |+----------------------------+| | | || |nbsp| :diagtext:`array` || | | |+----------------------------+| | +-------------------------------------------------+------------------------------+---------------------------------------------------------------------------------+ -Wpointer-sign -------------- This diagnostic is enabled by default. **Diagnostic text:** +---------------------------+----------------------------------------------------------------+----------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| |+--------------------------------------------------------------+| |nbsp| :diagtext:`converts between pointers to integer types with different sign`| | ||:diagtext:`assigning to different types` || | | |+--------------------------------------------------------------+| | | ||:diagtext:`passing to parameter of different type` || | | |+--------------------------------------------------------------+| | | ||:diagtext:`returning from function with different return type`|| | | |+--------------------------------------------------------------+| | | ||:diagtext:`converting between types` || | | |+--------------------------------------------------------------+| | | ||:diagtext:`initializing with expression of different type` || | | |+--------------------------------------------------------------+| | | ||:diagtext:`sending to parameter of different type` || | | |+--------------------------------------------------------------+| | | ||:diagtext:`casting between types` || | | |+--------------------------------------------------------------+| | +---------------------------+----------------------------------------------------------------+----------------------------------------------------------------------------------+ -Wpointer-to-int-cast --------------------- This diagnostic flag exists for GCC compatibility, and has no effect in Clang. -Wpointer-type-mismatch ----------------------- This diagnostic is enabled by default. **Diagnostic text:** +------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`pointer type mismatch`| +------------------------------------------------------------+ -Wpotentially-evaluated-expression ---------------------------------- This diagnostic is enabled by default. **Diagnostic text:** +----------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`expression with side effects will be evaluated despite being used as an operand to 'typeid'`| +----------------------------------------------------------------------------------------------------------------------------------+ -Wpragma-clang-attribute ------------------------ This diagnostic is enabled by default. **Diagnostic text:** +-------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`unused attribute` |nbsp| :placeholder:`A` |nbsp| :diagtext:`in '#pragma clang attribute push' region`| +-------------------------------------------------------------------------------------------------------------------------------------------+ -Wpragma-once-outside-header ---------------------------- This diagnostic is enabled by default. **Diagnostic text:** +----------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`#pragma once in main file`| +----------------------------------------------------------------+ -Wpragma-pack ------------- Some of the diagnostics controlled by this flag are enabled by default. Also controls `-Wpragma-pack-suspicious-include`_. **Diagnostic text:** +---------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`the current #pragma pack aligment value is modified in the included file`| +---------------------------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`unterminated '#pragma pack (push, ...)' at end of file`| +---------------------------------------------------------------------------------------------+ -Wpragma-pack-suspicious-include -------------------------------- **Diagnostic text:** +-------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`non-default #pragma pack value changes the alignment of struct or union members in the included file`| +-------------------------------------------------------------------------------------------------------------------------------------------+ -Wpragma-system-header-outside-header ------------------------------------- This diagnostic is enabled by default. **Diagnostic text:** +----------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`#pragma system\_header ignored in main file`| +----------------------------------------------------------------------------------+ -Wpragmas --------- Some of the diagnostics controlled by this flag are enabled by default. Also controls `-Wignored-pragmas`_, `-Wpragma-clang-attribute`_, `-Wpragma-pack`_, `-Wunknown-pragmas`_. **Diagnostic text:** +--------------------------------------------------------------------------------------------------------------------------------------+----------------------+------------------------+ |:warning:`warning:` |nbsp| :diagtext:`#pragma redefine\_extname is applicable to external C declarations only; not applied to` |nbsp| |+--------------------+| |nbsp| :placeholder:`B`| | ||:diagtext:`function`|| | | |+--------------------+| | | ||:diagtext:`variable`|| | | |+--------------------+| | +--------------------------------------------------------------------------------------------------------------------------------------+----------------------+------------------------+ -Wpredefined-identifier-outside-function ---------------------------------------- This diagnostic is enabled by default. **Diagnostic text:** +------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`predefined identifier is only valid inside function`| +------------------------------------------------------------------------------------------+ -Wprivate-extern ---------------- This diagnostic is enabled by default. **Diagnostic text:** +--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`use of \_\_private\_extern\_\_ on a declaration may not produce external symbol private to the linkage unit and is deprecated`| +--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wprivate-header ---------------- This diagnostic is an error by default, but the flag ``-Wno-private-header`` can be used to disable the error. **Diagnostic text:** +----------------------------------------------------------------------------------------------------------------+ |:error:`error:` |nbsp| :diagtext:`use of private header from outside its module: '`:placeholder:`A`:diagtext:`'`| +----------------------------------------------------------------------------------------------------------------+ -Wprivate-module ---------------- This diagnostic is enabled by default. **Diagnostic text:** -+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -|:warning:`warning:` |nbsp| :diagtext:`top-level module '`:placeholder:`A`:diagtext:`' in private module map, expected a submodule of '`:placeholder:`B`:diagtext:`'`| -+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ ++----------------------------------------------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`expected canonical name for private module '`:placeholder:`A`:diagtext:`'`| ++----------------------------------------------------------------------------------------------------------------+ ++----------------------------------------------------------------------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`private submodule '`:placeholder:`A`:diagtext:`' in private module map, expected top-level module`| ++----------------------------------------------------------------------------------------------------------------------------------------+ + +----------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`module '`:placeholder:`A`:diagtext:`' already re-exported as '`:placeholder:`B`:diagtext:`'`| +----------------------------------------------------------------------------------------------------------------------------------+ ++---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`no submodule named` |nbsp| :placeholder:`A` |nbsp| :diagtext:`in module '`:placeholder:`B`:diagtext:`'; using top level '`:placeholder:`C`:diagtext:`'`| ++---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + -Wprofile-instr-missing ----------------------- **Diagnostic text:** -+-----------------------------------------------------------------------------------------------------------------------------+---------------+---------------------------------------------+-------------------+---------------------------+ -|:warning:`warning:` |nbsp| :diagtext:`profile data may be incomplete: of` |nbsp| :placeholder:`A` |nbsp| :diagtext:`function`|+-------------+|:diagtext:`,` |nbsp| :placeholder:`B` |nbsp| |+-----------------+| |nbsp| :diagtext:`no data`| -| || || ||:diagtext:`:has` || | -| |+-------------+| |+-----------------+| | -| ||:diagtext:`s`|| ||:diagtext:`:have`|| | -| |+-------------+| |+-----------------+| | -+-----------------------------------------------------------------------------------------------------------------------------+---------------+---------------------------------------------+-------------------+---------------------------+ ++-----------------------------------------------------------------------------------------------------------------------------+---------------+---------------------------------------------+------------------+---------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`profile data may be incomplete: of` |nbsp| :placeholder:`A` |nbsp| :diagtext:`function`|+-------------+|:diagtext:`,` |nbsp| :placeholder:`B` |nbsp| |+----------------+| |nbsp| :diagtext:`no data`| +| || || ||:diagtext:`has` || | +| |+-------------+| |+----------------+| | +| ||:diagtext:`s`|| ||:diagtext:`have`|| | +| |+-------------+| |+----------------+| | ++-----------------------------------------------------------------------------------------------------------------------------+---------------+---------------------------------------------+------------------+---------------------------+ -Wprofile-instr-out-of-date --------------------------- This diagnostic is enabled by default. **Diagnostic text:** -+------------------------------------------------------------------------------------------------------------------------------+---------------+---------------------------------------------+-------------------+--------------------------------------------------------+ -|:warning:`warning:` |nbsp| :diagtext:`profile data may be out of date: of` |nbsp| :placeholder:`A` |nbsp| :diagtext:`function`|+-------------+|:diagtext:`,` |nbsp| :placeholder:`B` |nbsp| |+-----------------+| |nbsp| :diagtext:`mismatched data that will be ignored`| -| || || ||:diagtext:`:has` || | -| |+-------------+| |+-----------------+| | -| ||:diagtext:`s`|| ||:diagtext:`:have`|| | -| |+-------------+| |+-----------------+| | -+------------------------------------------------------------------------------------------------------------------------------+---------------+---------------------------------------------+-------------------+--------------------------------------------------------+ ++------------------------------------------------------------------------------------------------------------------------------+---------------+---------------------------------------------+------------------+--------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`profile data may be out of date: of` |nbsp| :placeholder:`A` |nbsp| :diagtext:`function`|+-------------+|:diagtext:`,` |nbsp| :placeholder:`B` |nbsp| |+----------------+| |nbsp| :diagtext:`mismatched data that will be ignored`| +| || || ||:diagtext:`has` || | +| |+-------------+| |+----------------+| | +| ||:diagtext:`s`|| ||:diagtext:`have`|| | +| |+-------------+| |+----------------+| | ++------------------------------------------------------------------------------------------------------------------------------+---------------+---------------------------------------------+------------------+--------------------------------------------------------+ -Wprofile-instr-unprofiled -------------------------- This diagnostic is enabled by default. **Diagnostic text:** +--------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`no profile data available for file "`:placeholder:`A`:diagtext:`"`| +--------------------------------------------------------------------------------------------------------+ -Wproperty-access-dot-syntax ---------------------------- This diagnostic is enabled by default. **Diagnostic text:** +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`property` |nbsp| :placeholder:`A` |nbsp| :diagtext:`not found on object of type` |nbsp| :placeholder:`B`:diagtext:`; did you mean to access property` |nbsp| :placeholder:`C`:diagtext:`?`| +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wproperty-attribute-mismatch ----------------------------- This diagnostic is enabled by default. **Diagnostic text:** +-------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`property attribute in class extension does not match the primary class`| +-------------------------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'`:placeholder:`B`:diagtext:`' attribute on property` |nbsp| :placeholder:`A` |nbsp| :diagtext:`does not match the property inherited from` |nbsp| :placeholder:`C`| +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`getter name mismatch between property redeclaration (`:placeholder:`B`:diagtext:`) and its original declaration (`:placeholder:`A`:diagtext:`)`| +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`attribute 'readonly' of property` |nbsp| :placeholder:`A` |nbsp| :diagtext:`restricts attribute 'readwrite' of property inherited from` |nbsp| :placeholder:`B`| +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wprotocol ---------- This diagnostic is enabled by default. **Diagnostic text:** +---------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`method` |nbsp| :placeholder:`A` |nbsp| :diagtext:`in protocol` |nbsp| :placeholder:`B` |nbsp| :diagtext:`not implemented`| +---------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wprotocol-property-synthesis-ambiguity --------------------------------------- This diagnostic is enabled by default. **Diagnostic text:** +-------------------------------------------------------+----------------------------------------------------------------+----------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`property` |nbsp| |+--------------------------------------------------------------+| |nbsp| :diagtext:`was selected for synthesis`| | ||+-------------------------------------------+ || | | |||:diagtext:`of type` |nbsp| :placeholder:`B`| || | | ||+-------------------------------------------+ || | | |+--------------------------------------------------------------+| | | ||+---------------------------------------------------------+ || | | |||:diagtext:`with attribute '`:placeholder:`B`:diagtext:`'`| || | | ||+---------------------------------------------------------+ || | | |+--------------------------------------------------------------+| | | ||+------------------------------------------------------------+|| | | |||:diagtext:`without attribute '`:placeholder:`B`:diagtext:`'`||| | | ||+------------------------------------------------------------+|| | | |+--------------------------------------------------------------+| | | ||+-----------------------------------------------+ || | | |||:diagtext:`with getter` |nbsp| :placeholder:`B`| || | | ||+-----------------------------------------------+ || | | |+--------------------------------------------------------------+| | | ||+-----------------------------------------------+ || | | |||:diagtext:`with setter` |nbsp| :placeholder:`B`| || | | ||+-----------------------------------------------+ || | | |+--------------------------------------------------------------+| | +-------------------------------------------------------+----------------------------------------------------------------+----------------------------------------------+ -Wqualified-void-return-type ---------------------------- This diagnostic is enabled by default. **Diagnostic text:** +---------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`function cannot return qualified void type` |nbsp| :placeholder:`A`| +---------------------------------------------------------------------------------------------------------+ +-Wquoted-include-in-framework-header +------------------------------------ +**Diagnostic text:** + ++-------------------------------------------------------------------------------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`double-quoted include "`:placeholder:`A`:diagtext:`" in framework header, expected angle-bracketed instead`| ++-------------------------------------------------------------------------------------------------------------------------------------------------+ + + -Wrange-loop-analysis --------------------- **Diagnostic text:** +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`loop variable` |nbsp| :placeholder:`A` |nbsp| |nbsp| :diagtext:`is initialized with a value of a different type` |nbsp| :diagtext:`resulting in a copy`| +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`loop variable` |nbsp| :placeholder:`A` |nbsp| :diagtext:`of type` |nbsp| :placeholder:`B` |nbsp| :diagtext:`creates a copy from type` |nbsp| :placeholder:`C`| +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`loop variable` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is always a copy because the range of type` |nbsp| :placeholder:`B` |nbsp| :diagtext:`does not return a reference`| +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wreadonly-iboutlet-property ---------------------------- This diagnostic is enabled by default. **Diagnostic text:** +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`readonly IBOutlet property` |nbsp| :placeholder:`A` |nbsp| :diagtext:`when auto-synthesized may not work correctly with 'nib' loader`| +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wreceiver-expr --------------- This diagnostic is enabled by default. **Diagnostic text:** +-------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`receiver type` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is not 'id' or interface pointer, consider casting it to 'id'`| +-------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wreceiver-forward-class ------------------------ Some of the diagnostics controlled by this flag are enabled by default. **Diagnostic text:** +--------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`receiver` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is a forward class and corresponding @interface may not exist`| +--------------------------------------------------------------------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`receiver type` |nbsp| :placeholder:`A` |nbsp| :diagtext:`for instance message is a forward declaration`| +---------------------------------------------------------------------------------------------------------------------------------------------+ -Wredeclared-class-member ------------------------- This diagnostic is enabled by default. **Diagnostic text:** +------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`class member cannot be redeclared`| +------------------------------------------------------------------------+ -Wredundant-decls ----------------- This diagnostic flag exists for GCC compatibility, and has no effect in Clang. -Wredundant-move ---------------- **Diagnostic text:** +-------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`redundant move in return statement`| +-------------------------------------------------------------------------+ -Wredundant-parens ------------------ **Diagnostic text:** +-----------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`redundant parentheses surrounding declarator`| +-----------------------------------------------------------------------------------+ -Wregister ---------- This diagnostic is enabled by default. Also controls `-Wdeprecated-register`_. **Diagnostic text:** +----------------------------------------------------------------------------------------------+ |:error:`error:` |nbsp| :diagtext:`ISO C++17 does not allow 'register' storage class specifier`| +----------------------------------------------------------------------------------------------+ -Wreinterpret-base-class ------------------------ This diagnostic is enabled by default. **Diagnostic text:** +------------------------------------------------------------------+------------------+---------------------------------------------------------+------------------+-------------------------------+-------------------------------------+-----------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'reinterpret\_cast'` |nbsp| |+----------------+| |nbsp| :diagtext:`class` |nbsp| :placeholder:`A` |nbsp| |+----------------+| |nbsp| :diagtext:`its` |nbsp| |+-----------------------------------+| |nbsp| :placeholder:`B` |nbsp| :diagtext:`behaves differently from 'static\_cast'`| | ||:diagtext:`from`|| ||:diagtext:`to` || ||:diagtext:`virtual base` || | | |+----------------+| |+----------------+| |+-----------------------------------+| | | ||:diagtext:`to` || ||:diagtext:`from`|| ||:diagtext:`base at non-zero offset`|| | | |+----------------+| |+----------------+| |+-----------------------------------+| | +------------------------------------------------------------------+------------------+---------------------------------------------------------+------------------+-------------------------------+-------------------------------------+-----------------------------------------------------------------------------------+ -Rremark-backend-plugin ----------------------- **Diagnostic text:** The text of this diagnostic is not controlled by Clang. -Wreorder --------- **Diagnostic text:** +---------------------------+------------------------+-----------------------------------------------------------------------------+-------------------+------------------------+ |:warning:`warning:` |nbsp| |+----------------------+| |nbsp| :placeholder:`B` |nbsp| :diagtext:`will be initialized after` |nbsp| |+-----------------+| |nbsp| :placeholder:`D`| | ||:diagtext:`field` || ||:diagtext:`field`|| | | |+----------------------+| |+-----------------+| | | ||:diagtext:`base class`|| ||:diagtext:`base` || | | |+----------------------+| |+-----------------+| | +---------------------------+------------------------+-----------------------------------------------------------------------------+-------------------+------------------------+ -Wrequires-super-attribute -------------------------- This diagnostic is enabled by default. **Diagnostic text:** +-----------------------------------------------------------------------------------------------------+----------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`attribute cannot be applied to` |nbsp| |+--------------------------------+| | ||:diagtext:`methods in protocols`|| | |+--------------------------------+| | ||:diagtext:`dealloc` || | |+--------------------------------+| +-----------------------------------------------------------------------------------------------------+----------------------------------+ -Wreserved-id-macro ------------------- **Diagnostic text:** +--------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`macro name is a reserved identifier`| +--------------------------------------------------------------------------+ -Wreserved-user-defined-literal ------------------------------- Some of the diagnostics controlled by this flag are enabled by default. Also controls `-Wc++11-compat-reserved-user-defined-literal`_. **Diagnostic text:** +-----------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`invalid suffix on literal; C++11 requires a space between literal and identifier`| +-----------------------------------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------------------------+ |:error:`error:` |nbsp| :diagtext:`invalid suffix on literal; C++11 requires a space between literal and identifier`| +-------------------------------------------------------------------------------------------------------------------+ -Wretained-language-linkage --------------------------- **Diagnostic text:** +-----------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`friend function` |nbsp| :placeholder:`A` |nbsp| :diagtext:`retaining previous language linkage is an extension`| +-----------------------------------------------------------------------------------------------------------------------------------------------------+ -Wreturn-stack-address ---------------------- This diagnostic is enabled by default. **Diagnostic text:** +---------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`returning address of label, which is local`| +---------------------------------------------------------------------------------+ +--------------------------------------------------------+--------------------------+------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`returning` |nbsp| |+------------------------+| |nbsp| :diagtext:`local temporary object`| | ||:diagtext:`address of` || | | |+------------------------+| | | ||:diagtext:`reference to`|| | | |+------------------------+| | +--------------------------------------------------------+--------------------------+------------------------------------------+ -+---------------------------+--------------------------+-------------------------------------------------------------------------------------------------------------------+ -|:warning:`warning:` |nbsp| |+------------------------+| |nbsp| :diagtext:`stack memory associated with local variable` |nbsp| :placeholder:`B` |nbsp| :diagtext:`returned`| -| ||:diagtext:`address of` || | -| |+------------------------+| | -| ||:diagtext:`reference to`|| | -| |+------------------------+| | -+---------------------------+--------------------------+-------------------------------------------------------------------------------------------------------------------+ ++---------------------------+--------------------------+--------------------------------------------------------+----------------------------+----------------------------------------------------+ +|:warning:`warning:` |nbsp| |+------------------------+| |nbsp| :diagtext:`stack memory associated with` |nbsp| |+--------------------------+| |nbsp| :placeholder:`B` |nbsp| :diagtext:`returned`| +| ||:diagtext:`address of` || ||:diagtext:`local variable`|| | +| |+------------------------+| |+--------------------------+| | +| ||:diagtext:`reference to`|| ||:diagtext:`parameter` || | +| |+------------------------+| |+--------------------------+| | ++---------------------------+--------------------------+--------------------------------------------------------+----------------------------+----------------------------------------------------+ +-Wreturn-std-move +----------------- +**Diagnostic text:** + ++-------------------------------------------------------------------------------------------------------------------------------------+----------------------+---------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`local variable` |nbsp| :placeholder:`A` |nbsp| :diagtext:`will be copied despite being` |nbsp| |+--------------------+| |nbsp| :diagtext:`by name`| +| ||:diagtext:`returned`|| | +| |+--------------------+| | +| ||:diagtext:`thrown` || | +| |+--------------------+| | ++-------------------------------------------------------------------------------------------------------------------------------------+----------------------+---------------------------+ + + +-Wreturn-std-move-in-c++11 +-------------------------- +**Diagnostic text:** + ++----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`prior to the resolution of a defect report against ISO C++11, local variable` |nbsp| :placeholder:`A` |nbsp| :diagtext:`would have been copied despite being returned by name, due to its not matching the function return type`| ++----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + + -Wreturn-type ------------- This diagnostic is enabled by default. Also controls `-Wreturn-type-c-linkage`_. **Diagnostic text:** +-----------------------+---------------------------+---------------------------------------------------------------------+ |:error:`error:` |nbsp| |+-------------------------+| |nbsp| :placeholder:`A` |nbsp| :diagtext:`should not return a value`| | ||:diagtext:`void function`|| | | |+-------------------------+| | | ||:diagtext:`void method` || | | |+-------------------------+| | | ||:diagtext:`constructor` || | | |+-------------------------+| | | ||:diagtext:`destructor` || | | |+-------------------------+| | +-----------------------+---------------------------+---------------------------------------------------------------------+ +---------------------------------------------------+----------------------+-----------------------------------------------------------------+ |:error:`error:` |nbsp| :diagtext:`non-void` |nbsp| |+--------------------+| |nbsp| :placeholder:`A` |nbsp| :diagtext:`should return a value`| | ||:diagtext:`function`|| | | |+--------------------+| | | ||:diagtext:`method` || | | |+--------------------+| | +---------------------------------------------------+----------------------+-----------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`control reaches end of coroutine; which is undefined behavior because the promise type` |nbsp| :placeholder:`A` |nbsp| :diagtext:`does not declare 'return\_void()'`| +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`control reaches end of non-void function`| +-------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`control reaches end of non-void lambda`| +-----------------------------------------------------------------------------+ +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`control may reach end of coroutine; which is undefined behavior because the promise type` |nbsp| :placeholder:`A` |nbsp| :diagtext:`does not declare 'return\_void()'`| +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`control may reach end of non-void function`| +---------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`control may reach end of non-void lambda`| +-------------------------------------------------------------------------------+ +---------------------------------------------------+----------------------+-----------------------------------------------------------------+ |:error:`error:` |nbsp| :diagtext:`non-void` |nbsp| |+--------------------+| |nbsp| :placeholder:`A` |nbsp| :diagtext:`should return a value`| | ||:diagtext:`function`|| | | |+--------------------+| | | ||:diagtext:`method` || | | |+--------------------+| | +---------------------------------------------------+----------------------+-----------------------------------------------------------------+ -Wreturn-type-c-linkage ----------------------- This diagnostic is enabled by default. **Diagnostic text:** +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`has C-linkage specified, but returns user-defined type` |nbsp| :placeholder:`B` |nbsp| :diagtext:`which is incompatible with C`| +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`has C-linkage specified, but returns incomplete type` |nbsp| :placeholder:`B` |nbsp| :diagtext:`which could be incompatible with C`| +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ --Wrtti-for-exceptions ---------------------- -This diagnostic is enabled by default. - -**Diagnostic text:** - -+--------------------------------------------------------------------------------------+ -|:warning:`warning:` |nbsp| :diagtext:`implicitly enabling rtti for exception handling`| -+--------------------------------------------------------------------------------------+ - - -Rsanitize-address ------------------ **Diagnostic text:** +--------------------------------------------------------------------------------------------------------+ |:remark:`remark:` |nbsp| :diagtext:`-fsanitize-address-field-padding applied to` |nbsp| :placeholder:`A`| +--------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------+ |:remark:`remark:` |nbsp| :diagtext:`-fsanitize-address-field-padding ignored for` |nbsp| :placeholder:`A` |nbsp| :diagtext:`because it` |nbsp| |+------------------------------------+| | ||:diagtext:`is not C++` || | |+------------------------------------+| | ||:diagtext:`is packed` || | |+------------------------------------+| | ||:diagtext:`is a union` || | |+------------------------------------+| | ||:diagtext:`is trivially copyable` || | |+------------------------------------+| | ||:diagtext:`has trivial destructor` || | |+------------------------------------+| | ||:diagtext:`is standard layout` || | |+------------------------------------+| | ||:diagtext:`is in a blacklisted file`|| | |+------------------------------------+| | ||:diagtext:`is blacklisted` || | |+------------------------------------+| +-----------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------+ -Wsection --------- This diagnostic is enabled by default. **Diagnostic text:** +--------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`section attribute is specified on redeclared variable`| +--------------------------------------------------------------------------------------------+ -+----------------------------------------------------------------------------------+ -|:warning:`warning:` |nbsp| :diagtext:`section does not match previous declaration`| -+----------------------------------------------------------------------------------+ ++------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`duplicate code segment specifiers`| ++------------------------------------------------------------------------+ ++---------------------------+---------------------+-------------------------------------------------------+ +|:warning:`warning:` |nbsp| |+-------------------+| |nbsp| :diagtext:`does not match previous declaration`| +| ||:diagtext:`codeseg`|| | +| |+-------------------+| | +| ||:diagtext:`section`|| | +| |+-------------------+| | ++---------------------------+---------------------+-------------------------------------------------------+ + -Wselector ---------- Also controls `-Wselector-type-mismatch`_. **Diagnostic text:** +-------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`no method with selector` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is implemented in this translation unit`| +-------------------------------------------------------------------------------------------------------------------------------------------------+ -Wselector-type-mismatch ------------------------ **Diagnostic text:** +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`several methods with selector` |nbsp| :placeholder:`A` |nbsp| :diagtext:`of mismatched types are found for the @selector expression`| +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wself-assign ------------- Some of the diagnostics controlled by this flag are enabled by default. -Also controls `-Wself-assign-field`_. +Also controls `-Wself-assign-field`_, `-Wself-assign-overloaded`_. **Diagnostic text:** +------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`explicitly assigning value of variable of type` |nbsp| :placeholder:`A` |nbsp| :diagtext:`to itself`| +------------------------------------------------------------------------------------------------------------------------------------------+ -Wself-assign-field ------------------- This diagnostic is enabled by default. **Diagnostic text:** +--------------------------------------------------------+-------------------------------+-----------------------------+ |:warning:`warning:` |nbsp| :diagtext:`assigning` |nbsp| |+-----------------------------+| |nbsp| :diagtext:`to itself`| | ||:diagtext:`field` || | | |+-----------------------------+| | | ||:diagtext:`instance variable`|| | | |+-----------------------------+| | +--------------------------------------------------------+-------------------------------+-----------------------------+ +-Wself-assign-overloaded +------------------------ +**Diagnostic text:** + ++------------------------------------------------------------------------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`explicitly assigning value of variable of type` |nbsp| :placeholder:`A` |nbsp| :diagtext:`to itself`| ++------------------------------------------------------------------------------------------------------------------------------------------+ + + -Wself-move ----------- **Diagnostic text:** +------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`explicitly moving variable of type` |nbsp| :placeholder:`A` |nbsp| :diagtext:`to itself`| +------------------------------------------------------------------------------------------------------------------------------+ -Wsemicolon-before-method-body ------------------------------ **Diagnostic text:** +------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`semicolon before method body is ignored`| +------------------------------------------------------------------------------+ -Wsentinel ---------- This diagnostic is enabled by default. **Diagnostic text:** +------------------------------------------------------------------+-----------------------------+ |:warning:`warning:` |nbsp| :diagtext:`missing sentinel in` |nbsp| |+---------------------------+| | ||:diagtext:`function call` || | |+---------------------------+| | ||:diagtext:`method dispatch`|| | |+---------------------------+| | ||:diagtext:`block call` || | |+---------------------------+| +------------------------------------------------------------------+-----------------------------+ +------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`not enough variable arguments in` |nbsp| :placeholder:`A` |nbsp| :diagtext:`declaration to fit a sentinel`| +------------------------------------------------------------------------------------------------------------------------------------------------+ -Wsequence-point ---------------- Synonym for `-Wunsequenced`_. -Wserialized-diagnostics ------------------------ This diagnostic is enabled by default. **Diagnostic text:** +----------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`unable to open file` |nbsp| :placeholder:`A` |nbsp| :diagtext:`for serializing diagnostics (`:placeholder:`B`:diagtext:`)`| +----------------------------------------------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`unable to merge a subprocess's serialized diagnostics`| +--------------------------------------------------------------------------------------------+ -Wshadow -------- Some of the diagnostics controlled by this flag are enabled by default. Also controls `-Wshadow-field-in-constructor-modified`_, `-Wshadow-ivar`_. **Diagnostic text:** +--------------------------------------------------------------------+-------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`declaration shadows a` |nbsp| |+-----------------------------------------------------------+| | ||:diagtext:`local variable` || | |+-----------------------------------------------------------+| | ||+-----------------------------------------------+ || | |||:diagtext:`variable in` |nbsp| :placeholder:`C`| || | ||+-----------------------------------------------+ || | |+-----------------------------------------------------------+| | ||+---------------------------------------------------------+|| | |||:diagtext:`static data member of` |nbsp| :placeholder:`C`||| | ||+---------------------------------------------------------+|| | |+-----------------------------------------------------------+| | ||+--------------------------------------------+ || | |||:diagtext:`field of` |nbsp| :placeholder:`C`| || | ||+--------------------------------------------+ || | |+-----------------------------------------------------------+| | ||+----------------------------------------------+ || | |||:diagtext:`typedef in` |nbsp| :placeholder:`C`| || | ||+----------------------------------------------+ || | |+-----------------------------------------------------------+| | ||+-------------------------------------------------+ || | |||:diagtext:`type alias in` |nbsp| :placeholder:`C`| || | ||+-------------------------------------------------+ || | |+-----------------------------------------------------------+| +--------------------------------------------------------------------+-------------------------------------------------------------+ -Wshadow-all ------------ Some of the diagnostics controlled by this flag are enabled by default. Controls `-Wshadow`_, `-Wshadow-field`_, `-Wshadow-field-in-constructor`_, `-Wshadow-uncaptured-local`_. -Wshadow-field -------------- **Diagnostic text:** -+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -|:warning:`warning:` |nbsp| :diagtext:`non-static data member '`:placeholder:`A`:diagtext:`' of '`:placeholder:`B`:diagtext:`' shadows member inherited from type '`:placeholder:`C`:diagtext:`'`| -+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ ++-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`non-static data member` |nbsp| :placeholder:`A` |nbsp| :diagtext:`of` |nbsp| :placeholder:`B` |nbsp| :diagtext:`shadows member inherited from type` |nbsp| :placeholder:`C`| ++-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wshadow-field-in-constructor ----------------------------- Also controls `-Wshadow-field-in-constructor-modified`_. **Diagnostic text:** +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`constructor parameter` |nbsp| :placeholder:`A` |nbsp| :diagtext:`shadows the field` |nbsp| :placeholder:`B` |nbsp| :diagtext:`of` |nbsp| :placeholder:`C`| +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wshadow-field-in-constructor-modified -------------------------------------- **Diagnostic text:** +-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`modifying constructor parameter` |nbsp| :placeholder:`A` |nbsp| :diagtext:`that shadows a field of` |nbsp| :placeholder:`B`| +-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wshadow-ivar ------------- This diagnostic is enabled by default. **Diagnostic text:** +------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`local declaration of` |nbsp| :placeholder:`A` |nbsp| :diagtext:`hides instance variable`| +------------------------------------------------------------------------------------------------------------------------------+ -Wshadow-uncaptured-local ------------------------- **Diagnostic text:** +--------------------------------------------------------------------+-------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`declaration shadows a` |nbsp| |+-----------------------------------------------------------+| | ||:diagtext:`local variable` || | |+-----------------------------------------------------------+| | ||+-----------------------------------------------+ || | |||:diagtext:`variable in` |nbsp| :placeholder:`C`| || | ||+-----------------------------------------------+ || | |+-----------------------------------------------------------+| | ||+---------------------------------------------------------+|| | |||:diagtext:`static data member of` |nbsp| :placeholder:`C`||| | ||+---------------------------------------------------------+|| | |+-----------------------------------------------------------+| | ||+--------------------------------------------+ || | |||:diagtext:`field of` |nbsp| :placeholder:`C`| || | ||+--------------------------------------------+ || | |+-----------------------------------------------------------+| | ||+----------------------------------------------+ || | |||:diagtext:`typedef in` |nbsp| :placeholder:`C`| || | ||+----------------------------------------------+ || | |+-----------------------------------------------------------+| | ||+-------------------------------------------------+ || | |||:diagtext:`type alias in` |nbsp| :placeholder:`C`| || | ||+-------------------------------------------------+ || | |+-----------------------------------------------------------+| +--------------------------------------------------------------------+-------------------------------------------------------------+ -Wshift-count-negative ---------------------- This diagnostic is enabled by default. **Diagnostic text:** +--------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`shift count is negative`| +--------------------------------------------------------------+ -Wshift-count-overflow ---------------------- This diagnostic is enabled by default. **Diagnostic text:** +-------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`shift count >= width of type`| +-------------------------------------------------------------------+ -Wshift-negative-value ---------------------- This diagnostic is enabled by default. **Diagnostic text:** +------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`shifting a negative signed value is undefined`| +------------------------------------------------------------------------------------+ -Wshift-op-parentheses ---------------------- This diagnostic is enabled by default. **Diagnostic text:** +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`operator '`:placeholder:`A`:diagtext:`' has lower precedence than '`:placeholder:`B`:diagtext:`'; '`:placeholder:`B`:diagtext:`' will be evaluated first`| +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wshift-overflow ---------------- This diagnostic is enabled by default. **Diagnostic text:** +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`signed shift result (`:placeholder:`A`:diagtext:`) requires` |nbsp| :placeholder:`B` |nbsp| :diagtext:`bits to represent, but` |nbsp| :placeholder:`C` |nbsp| :diagtext:`only has` |nbsp| :placeholder:`D` |nbsp| :diagtext:`bits`| +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wshift-sign-overflow --------------------- **Diagnostic text:** +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`signed shift result (`:placeholder:`A`:diagtext:`) sets the sign bit of the shift expression's type (`:placeholder:`B`:diagtext:`) and becomes negative`| +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wshorten-64-to-32 ------------------ **Diagnostic text:** +---------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`implicit conversion loses integer precision:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`to` |nbsp| :placeholder:`B`| +---------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wsign-compare -------------- **Diagnostic text:** +--------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`comparison of integers of different signs:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`and` |nbsp| :placeholder:`B`| +--------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wsign-conversion ----------------- **Diagnostic text:** +----------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`implicit conversion changes signedness:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`to` |nbsp| :placeholder:`B`| +----------------------------------------------------------------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`operand of ? changes signedness:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`to` |nbsp| :placeholder:`B`| +---------------------------------------------------------------------------------------------------------------------------------------------+ -Wsign-promo ------------ This diagnostic flag exists for GCC compatibility, and has no effect in Clang. -Wsigned-enum-bitfield ---------------------- **Diagnostic text:** +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`enums in the Microsoft ABI are signed integers by default; consider giving the enum` |nbsp| :placeholder:`A` |nbsp| :diagtext:`an unsigned underlying type to make this code portable`| +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wsizeof-array-argument ----------------------- This diagnostic is enabled by default. **Diagnostic text:** +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`sizeof on array function parameter will return size of` |nbsp| :placeholder:`A` |nbsp| :diagtext:`instead of` |nbsp| :placeholder:`B`| +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wsizeof-array-decay -------------------- This diagnostic is enabled by default. **Diagnostic text:** +--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`sizeof on pointer operation will return size of` |nbsp| :placeholder:`A` |nbsp| :diagtext:`instead of` |nbsp| :placeholder:`B`| +--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wsizeof-pointer-memaccess -------------------------- This diagnostic is enabled by default. **Diagnostic text:** +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'`:placeholder:`A`:diagtext:`' call operates on objects of type` |nbsp| :placeholder:`B` |nbsp| :diagtext:`while the size is based on a different type` |nbsp| :placeholder:`C`| +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------+---------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`argument to 'sizeof' in` |nbsp| :placeholder:`A` |nbsp| :diagtext:`call is the same pointer type` |nbsp| :placeholder:`B` |nbsp| :diagtext:`as the` |nbsp| |+-----------------------+|:diagtext:`; expected` |nbsp| :placeholder:`D` |nbsp| :diagtext:`or an explicit length`| | ||:diagtext:`destination`|| | | |+-----------------------+| | | ||:diagtext:`source` || | | |+-----------------------+| | +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------+---------------------------------------------------------------------------------------+ -Wslash-u-filename ------------------ This diagnostic is enabled by default. **Diagnostic text:** +--------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'/U`:placeholder:`A`:diagtext:`' treated as the '/U' option`| +--------------------------------------------------------------------------------------------------+ -Wsometimes-uninitialized ------------------------- **Diagnostic text:** +-----------------------------------------------------------------------------------------------------+----------------------+--------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`variable` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is` |nbsp| |+--------------------+| |nbsp| :diagtext:`uninitialized whenever` |nbsp| |+------------------------------------------------------------------------------------------------------------+| | ||:diagtext:`used` || ||+---------------------------------------------------------------+-------------------+ || | |+--------------------+| |||:diagtext:`'`:placeholder:`D`:diagtext:`' condition is` |nbsp| |+-----------------+| || | ||:diagtext:`captured`|| ||| ||:diagtext:`true` || || | |+--------------------+| ||| |+-----------------+| || | | | ||| ||:diagtext:`false`|| || | | | ||| |+-----------------+| || | | | ||+---------------------------------------------------------------+-------------------+ || | | | |+------------------------------------------------------------------------------------------------------------+| | | | ||+-------------------------------------------------------+--------------------------------------------------+|| | | | |||:diagtext:`'`:placeholder:`D`:diagtext:`' loop` |nbsp| |+------------------------------------------------+||| | | | ||| ||:diagtext:`is entered` |||| | | | ||| |+------------------------------------------------+||| | | | ||| ||:diagtext:`exits because its condition is false`|||| | | | ||| |+------------------------------------------------+||| | | | ||+-------------------------------------------------------+--------------------------------------------------+|| | | | |+------------------------------------------------------------------------------------------------------------+| | | | ||+-------------------------------------------------------+--------------------------------------------------+|| | | | |||:diagtext:`'`:placeholder:`D`:diagtext:`' loop` |nbsp| |+------------------------------------------------+||| | | | ||| ||:diagtext:`condition is true` |||| | | | ||| |+------------------------------------------------+||| | | | ||| ||:diagtext:`exits because its condition is false`|||| | | | ||| |+------------------------------------------------+||| | | | ||+-------------------------------------------------------+--------------------------------------------------+|| | | | |+------------------------------------------------------------------------------------------------------------+| | | | ||+----------------------------------------------------------------------+ || | | | |||:diagtext:`switch` |nbsp| :placeholder:`D` |nbsp| :diagtext:`is taken`| || | | | ||+----------------------------------------------------------------------+ || | | | |+------------------------------------------------------------------------------------------------------------+| | | | ||:diagtext:`its declaration is reached` || | | | |+------------------------------------------------------------------------------------------------------------+| | | | ||+---------------------------------------------+ || | | | |||:placeholder:`D` |nbsp| :diagtext:`is called`| || | | | ||+---------------------------------------------+ || | | | |+------------------------------------------------------------------------------------------------------------+| +-----------------------------------------------------------------------------------------------------+----------------------+--------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ -Wsource-uses-openmp -------------------- Some of the diagnostics controlled by this flag are enabled by default. **Diagnostic text:** +------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`OpenMP only allows an ordered construct with the simd clause nested in a simd construct`| +------------------------------------------------------------------------------------------------------------------------------+ +------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`unexpected '#pragma omp ...' in program`| +------------------------------------------------------------------------------+ -Wspir-compat ------------- **Diagnostic text:** +----------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`sampler initializer has invalid` |nbsp| :placeholder:`A` |nbsp| :diagtext:`bits`| +----------------------------------------------------------------------------------------------------------------------+ -Wstack-protector ----------------- This diagnostic flag exists for GCC compatibility, and has no effect in Clang. -Wstatic-float-init ------------------- This diagnostic is enabled by default. Also controls `-Wgnu-static-float-init`_. **Diagnostic text:** +----------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:error:`error:` |nbsp| :diagtext:`in-class initializer for static data member of type` |nbsp| :placeholder:`A` |nbsp| :diagtext:`requires 'constexpr' specifier`| +----------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wstatic-in-inline ------------------ Some of the diagnostics controlled by this flag are enabled by default. **Diagnostic text:** +-----------------------------------------------------+----------------------+-----------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`static` |nbsp| |+--------------------+| |nbsp| :placeholder:`B` |nbsp| :diagtext:`is used in an inline function with external linkage`| | ||:diagtext:`function`|| | | |+--------------------+| | | ||:diagtext:`variable`|| | | |+--------------------+| | +-----------------------------------------------------+----------------------+-----------------------------------------------------------------------------------------------+ +-----------------------------------------------------+----------------------+-----------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`static` |nbsp| |+--------------------+| |nbsp| :placeholder:`B` |nbsp| :diagtext:`is used in an inline function with external linkage`| | ||:diagtext:`function`|| | | |+--------------------+| | | ||:diagtext:`variable`|| | | |+--------------------+| | +-----------------------------------------------------+----------------------+-----------------------------------------------------------------------------------------------+ -Wstatic-inline-explicit-instantiation -------------------------------------- This diagnostic is enabled by default. **Diagnostic text:** +-------------------------------------------------+--------------------+--------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`ignoring '`|+------------------+|:diagtext:`' keyword on explicit template instantiation`| | ||:diagtext:`static`|| | | |+------------------+| | | ||:diagtext:`inline`|| | | |+------------------+| | +-------------------------------------------------+--------------------+--------------------------------------------------------+ -Wstatic-local-in-inline ------------------------ This diagnostic is enabled by default. **Diagnostic text:** +--------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`non-constant static local variable in inline function may be different in different files`| +--------------------------------------------------------------------------------------------------------------------------------+ -Wstatic-self-init ------------------ This diagnostic is enabled by default. **Diagnostic text:** +----------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`static variable` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is suspiciously used within its own initialization`| +----------------------------------------------------------------------------------------------------------------------------------------------------+ +-Wstdlibcxx-not-found +--------------------- +This diagnostic is enabled by default. + +**Diagnostic text:** + ++----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead`| ++----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + + -Wstrict-aliasing ----------------- This diagnostic flag exists for GCC compatibility, and has no effect in Clang. -Wstrict-aliasing=0 ------------------- This diagnostic flag exists for GCC compatibility, and has no effect in Clang. -Wstrict-aliasing=1 ------------------- This diagnostic flag exists for GCC compatibility, and has no effect in Clang. -Wstrict-aliasing=2 ------------------- This diagnostic flag exists for GCC compatibility, and has no effect in Clang. -Wstrict-overflow ----------------- This diagnostic flag exists for GCC compatibility, and has no effect in Clang. -Wstrict-overflow=0 ------------------- This diagnostic flag exists for GCC compatibility, and has no effect in Clang. -Wstrict-overflow=1 ------------------- This diagnostic flag exists for GCC compatibility, and has no effect in Clang. -Wstrict-overflow=2 ------------------- This diagnostic flag exists for GCC compatibility, and has no effect in Clang. -Wstrict-overflow=3 ------------------- This diagnostic flag exists for GCC compatibility, and has no effect in Clang. -Wstrict-overflow=4 ------------------- This diagnostic flag exists for GCC compatibility, and has no effect in Clang. -Wstrict-overflow=5 ------------------- This diagnostic flag exists for GCC compatibility, and has no effect in Clang. -Wstrict-prototypes ------------------- **Diagnostic text:** +---------------------------------------------------+--------------------------------------------------------------+-------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`this` |nbsp| |+------------------------------------------------------------+| |nbsp| :diagtext:`a prototype`| | ||:diagtext:`function declaration is not` || | | |+------------------------------------------------------------+| | | ||:diagtext:`block declaration is not` || | | |+------------------------------------------------------------+| | | ||:diagtext:`old-style function definition is not preceded by`|| | | |+------------------------------------------------------------+| | +---------------------------------------------------+--------------------------------------------------------------+-------------------------------+ -Wstrict-prototypes ------------------- **Diagnostic text:** +---------------------------------------------------+--------------------------------------------------------------+-------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`this` |nbsp| |+------------------------------------------------------------+| |nbsp| :diagtext:`a prototype`| | ||:diagtext:`function declaration is not` || | | |+------------------------------------------------------------+| | | ||:diagtext:`block declaration is not` || | | |+------------------------------------------------------------+| | | ||:diagtext:`old-style function definition is not preceded by`|| | | |+------------------------------------------------------------+| | +---------------------------------------------------+--------------------------------------------------------------+-------------------------------+ -Wstrict-selector-match ----------------------- **Diagnostic text:** +--------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`multiple methods named` |nbsp| :placeholder:`A` |nbsp| :diagtext:`found`| +--------------------------------------------------------------------------------------------------------------+ -Wstring-compare ---------------- This diagnostic is enabled by default. **Diagnostic text:** +---------------------------------------------------------------------------+------------------------------+--------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`result of comparison against` |nbsp| |+----------------------------+| |nbsp| :diagtext:`is unspecified (use strncmp instead)`| | ||:diagtext:`a string literal`|| | | |+----------------------------+| | | ||:diagtext:`@encode` || | | |+----------------------------+| | +---------------------------------------------------------------------------+------------------------------+--------------------------------------------------------+ -Wstring-conversion ------------------- **Diagnostic text:** +----------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`implicit conversion turns string literal into bool:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`to` |nbsp| :placeholder:`B`| +----------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wstring-plus-char ------------------ This diagnostic is enabled by default. **Diagnostic text:** +------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`adding` |nbsp| :placeholder:`A` |nbsp| :diagtext:`to a string pointer does not append to the string`| +------------------------------------------------------------------------------------------------------------------------------------------+ -Wstring-plus-int ----------------- This diagnostic is enabled by default. **Diagnostic text:** +----------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`adding` |nbsp| :placeholder:`A` |nbsp| :diagtext:`to a string does not append to the string`| +----------------------------------------------------------------------------------------------------------------------------------+ -Wstrlcpy-strlcat-size ---------------------- This diagnostic is enabled by default. **Diagnostic text:** +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`size argument in` |nbsp| :placeholder:`A` |nbsp| :diagtext:`call appears to be size of the source; expected the size of the destination`| +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wstrncat-size -------------- This diagnostic is enabled by default. **Diagnostic text:** +--------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`the value of the size argument in 'strncat' is too large, might lead to a buffer overflow`| +--------------------------------------------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`size argument in 'strncat' call appears to be size of the source`| +-------------------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`the value of the size argument to 'strncat' is wrong`| +-------------------------------------------------------------------------------------------+ -Wsuper-class-method-mismatch ----------------------------- **Diagnostic text:** +--------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`method parameter type` |nbsp| :diagtext:`does not match super class method parameter type`| +--------------------------------------------------------------------------------------------------------------------------------+ +-Wsuspicious-bzero +------------------ +This diagnostic is enabled by default. + +**Diagnostic text:** + ++----------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`'size' argument to bzero is '0'`| ++----------------------------------------------------------------------+ + + +-Wsuspicious-memaccess +---------------------- +This diagnostic is enabled by default. + +Controls `-Wdynamic-class-memaccess`_, `-Wmemset-transposed-args`_, `-Wnontrivial-memaccess`_, `-Wsizeof-pointer-memaccess`_, `-Wsuspicious-bzero`_. + + -Wswitch -------- This diagnostic is enabled by default. **Diagnostic text:** +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`overflow converting case value to switch condition type (`:placeholder:`A` |nbsp| :diagtext:`to` |nbsp| :placeholder:`B`:diagtext:`)`| +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -+---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -|:warning:`warning:` |nbsp| |+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+| -| ||+-----------------------------------------------------------------------------------------------+ || -| |||:diagtext:`:enumeration value` |nbsp| :placeholder:`B` |nbsp| :diagtext:`not handled in switch`| || -| ||+-----------------------------------------------------------------------------------------------+ || -| |+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+| -| ||+-----------------------------------------------------------------------------------------------------------------------------------------------+ || -| |||:diagtext:`:enumeration values` |nbsp| :placeholder:`B` |nbsp| :diagtext:`and` |nbsp| :placeholder:`C` |nbsp| :diagtext:`not handled in switch`| || -| ||+-----------------------------------------------------------------------------------------------------------------------------------------------+ || -| |+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+| -| ||+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ || -| |||:diagtext:`:enumeration values` |nbsp| :placeholder:`B`:diagtext:`,` |nbsp| :placeholder:`C`:diagtext:`, and` |nbsp| :placeholder:`D` |nbsp| :diagtext:`not handled in switch`| || -| ||+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ || -| |+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+| -| ||+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+|| -| |||:diagtext:`:`:placeholder:`A` |nbsp| :diagtext:`enumeration values not handled in switch:` |nbsp| :placeholder:`B`:diagtext:`,` |nbsp| :placeholder:`C`:diagtext:`,` |nbsp| :placeholder:`D`:diagtext:`...`||| -| ||+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+|| -| |+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+| -+---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ ++---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| |+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+| +| ||+----------------------------------------------------------------------------------------------+ || +| |||:diagtext:`enumeration value` |nbsp| :placeholder:`B` |nbsp| :diagtext:`not handled in switch`| || +| ||+----------------------------------------------------------------------------------------------+ || +| |+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+| +| ||+----------------------------------------------------------------------------------------------------------------------------------------------+ || +| |||:diagtext:`enumeration values` |nbsp| :placeholder:`B` |nbsp| :diagtext:`and` |nbsp| :placeholder:`C` |nbsp| :diagtext:`not handled in switch`| || +| ||+----------------------------------------------------------------------------------------------------------------------------------------------+ || +| |+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+| +| ||+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ || +| |||:diagtext:`enumeration values` |nbsp| :placeholder:`B`:diagtext:`,` |nbsp| :placeholder:`C`:diagtext:`, and` |nbsp| :placeholder:`D` |nbsp| :diagtext:`not handled in switch`| || +| ||+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ || +| |+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+| +| ||+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+|| +| |||:placeholder:`A` |nbsp| :diagtext:`enumeration values not handled in switch:` |nbsp| :placeholder:`B`:diagtext:`,` |nbsp| :placeholder:`C`:diagtext:`,` |nbsp| :placeholder:`D`:diagtext:`...`||| +| ||+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+|| +| |+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+| ++---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`case value not in enumerated type` |nbsp| :placeholder:`A`| +------------------------------------------------------------------------------------------------+ -Wswitch-bool ------------- This diagnostic is enabled by default. **Diagnostic text:** +-------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`switch condition has boolean value`| +-------------------------------------------------------------------------+ -Wswitch-default ---------------- This diagnostic flag exists for GCC compatibility, and has no effect in Clang. -Wswitch-enum ------------- **Diagnostic text:** -+---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -|:warning:`warning:` |nbsp| |+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+| -| ||+----------------------------------------------------------------------------------------------------------+ || -| |||:diagtext:`:enumeration value` |nbsp| :placeholder:`B` |nbsp| :diagtext:`not explicitly handled in switch`| || -| ||+----------------------------------------------------------------------------------------------------------+ || -| |+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+| -| ||+----------------------------------------------------------------------------------------------------------------------------------------------------------+ || -| |||:diagtext:`:enumeration values` |nbsp| :placeholder:`B` |nbsp| :diagtext:`and` |nbsp| :placeholder:`C` |nbsp| :diagtext:`not explicitly handled in switch`| || -| ||+----------------------------------------------------------------------------------------------------------------------------------------------------------+ || -| |+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+| -| ||+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ || -| |||:diagtext:`:enumeration values` |nbsp| :placeholder:`B`:diagtext:`,` |nbsp| :placeholder:`C`:diagtext:`, and` |nbsp| :placeholder:`D` |nbsp| :diagtext:`not explicitly handled in switch`| || -| ||+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ || -| |+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+| -| ||+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+|| -| |||:diagtext:`:`:placeholder:`A` |nbsp| :diagtext:`enumeration values not explicitly handled in switch:` |nbsp| :placeholder:`B`:diagtext:`,` |nbsp| :placeholder:`C`:diagtext:`,` |nbsp| :placeholder:`D`:diagtext:`...`||| -| ||+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+|| -| |+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+| -+---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ ++---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| |+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+| +| ||+---------------------------------------------------------------------------------------------------------+ || +| |||:diagtext:`enumeration value` |nbsp| :placeholder:`B` |nbsp| :diagtext:`not explicitly handled in switch`| || +| ||+---------------------------------------------------------------------------------------------------------+ || +| |+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+| +| ||+---------------------------------------------------------------------------------------------------------------------------------------------------------+ || +| |||:diagtext:`enumeration values` |nbsp| :placeholder:`B` |nbsp| :diagtext:`and` |nbsp| :placeholder:`C` |nbsp| :diagtext:`not explicitly handled in switch`| || +| ||+---------------------------------------------------------------------------------------------------------------------------------------------------------+ || +| |+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+| +| ||+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ || +| |||:diagtext:`enumeration values` |nbsp| :placeholder:`B`:diagtext:`,` |nbsp| :placeholder:`C`:diagtext:`, and` |nbsp| :placeholder:`D` |nbsp| :diagtext:`not explicitly handled in switch`| || +| ||+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ || +| |+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+| +| ||+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+|| +| |||:placeholder:`A` |nbsp| :diagtext:`enumeration values not explicitly handled in switch:` |nbsp| :placeholder:`B`:diagtext:`,` |nbsp| :placeholder:`C`:diagtext:`,` |nbsp| :placeholder:`D`:diagtext:`...`||| +| ||+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+|| +| |+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+| ++---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wsync-fetch-and-nand-semantics-changed --------------------------------------- This diagnostic is enabled by default. **Diagnostic text:** +-------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`the semantics of this intrinsic changed with GCC version 4.4 - the newer semantics are provided here`| +-------------------------------------------------------------------------------------------------------------------------------------------+ -Wsynth ------- This diagnostic flag exists for GCC compatibility, and has no effect in Clang. -Wtautological-compare ---------------------- Some of the diagnostics controlled by this flag are enabled by default. Also controls `-Wtautological-constant-compare`_, `-Wtautological-overlap-compare`_, `-Wtautological-pointer-compare`_, `-Wtautological-undefined-compare`_. **Diagnostic text:** +---------------------------+---------------------------+--------------------------------------------------+------------------------+ |:warning:`warning:` |nbsp| |+-------------------------+|:diagtext:`comparison always evaluates to` |nbsp| |+----------------------+| -| ||:diagtext:`self-` || ||:diagtext:`false` || +| ||:diagtext:`self-` || ||:diagtext:`a constant`|| | |+-------------------------+| |+----------------------+| -| ||:diagtext:`array` |nbsp| || ||:diagtext:`true` || +| ||:diagtext:`array` |nbsp| || ||:placeholder:`C` || | |+-------------------------+| |+----------------------+| -| | | ||:diagtext:`a constant`|| -| | | |+----------------------+| +---------------------------+---------------------------+--------------------------------------------------+------------------------+ +-------------------------------------------------------------------------------------+-------------------+ |:warning:`warning:` |nbsp| :diagtext:`bitwise comparison always evaluates to` |nbsp| |+-----------------+| | ||:diagtext:`false`|| | |+-----------------+| | ||:diagtext:`true` || | |+-----------------+| +-------------------------------------------------------------------------------------+-------------------+ -Wtautological-constant-compare ------------------------------- This diagnostic is enabled by default. -Also controls `-Wtautological-constant-out-of-range-compare`_, `-Wtautological-unsigned-enum-zero-compare`_, `-Wtautological-unsigned-zero-compare`_. +Also controls `-Wtautological-constant-out-of-range-compare`_. **Diagnostic text:** -+---------------------------------------------------------+------------------+--------------------------------+------------------+-------------------------------------+-------------------+ -|:warning:`warning:` |nbsp| :diagtext:`comparison` |nbsp| |+----------------+| |nbsp| :placeholder:`C` |nbsp| |+----------------+| |nbsp| :diagtext:`is always` |nbsp| |+-----------------+| -| ||:placeholder:`D`|| ||:placeholder:`B`|| ||:diagtext:`false`|| -| |+----------------+| |+----------------+| |+-----------------+| -| ||:placeholder:`B`|| ||:placeholder:`D`|| ||:diagtext:`true` || -| |+----------------+| |+----------------+| |+-----------------+| -+---------------------------------------------------------+------------------+--------------------------------+------------------+-------------------------------------+-------------------+ ++----------------------------------------------------------------------+------------------------------------------------+--------------------------------+----------------------------------------------------------+-----------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`result of comparison of` |nbsp| |+----------------------------------------------+| |nbsp| :diagtext:`with` |nbsp| |+--------------------------------------------------------+| |nbsp| :diagtext:`is always` |nbsp| :placeholder:`E`| +| ||+--------------------------------------------+|| ||+------------------------------------------------------+|| | +| |||:diagtext:`constant` |nbsp| :placeholder:`A`||| |||:diagtext:`expression of type` |nbsp| :placeholder:`C`||| | +| ||+--------------------------------------------+|| ||+------------------------------------------------------+|| | +| |+----------------------------------------------+| |+--------------------------------------------------------+| | +| ||:diagtext:`true` || ||:diagtext:`boolean expression` || | +| |+----------------------------------------------+| |+--------------------------------------------------------+| | +| ||:diagtext:`false` || | | | +| |+----------------------------------------------+| | | | ++----------------------------------------------------------------------+------------------------------------------------+--------------------------------+----------------------------------------------------------+-----------------------------------------------------+ +-Wtautological-constant-in-range-compare +---------------------------------------- +Controls `-Wtautological-type-limit-compare`_, `-Wtautological-unsigned-enum-zero-compare`_, `-Wtautological-unsigned-zero-compare`_. + + -Wtautological-constant-out-of-range-compare -------------------------------------------- This diagnostic is enabled by default. **Diagnostic text:** -+------------------------------------------------------------+------------------------------------------------+--------------------------------+----------------------------------------------------------+-------------------------------------+-------------------+ -|:warning:`warning:` |nbsp| :diagtext:`comparison of` |nbsp| |+----------------------------------------------+| |nbsp| :diagtext:`with` |nbsp| |+--------------------------------------------------------+| |nbsp| :diagtext:`is always` |nbsp| |+-----------------+| -| ||+--------------------------------------------+|| ||+------------------------------------------------------+|| ||:diagtext:`false`|| -| |||:diagtext:`constant` |nbsp| :placeholder:`A`||| |||:diagtext:`expression of type` |nbsp| :placeholder:`C`||| |+-----------------+| -| ||+--------------------------------------------+|| ||+------------------------------------------------------+|| ||:diagtext:`true` || -| |+----------------------------------------------+| |+--------------------------------------------------------+| |+-----------------+| -| ||:diagtext:`true` || ||:diagtext:`boolean expression` || | | -| |+----------------------------------------------+| |+--------------------------------------------------------+| | | -| ||:diagtext:`false` || | | | | -| |+----------------------------------------------+| | | | | -+------------------------------------------------------------+------------------------------------------------+--------------------------------+----------------------------------------------------------+-------------------------------------+-------------------+ ++----------------------------------------------------------------------+------------------------------------------------+--------------------------------+----------------------------------------------------------+-----------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`result of comparison of` |nbsp| |+----------------------------------------------+| |nbsp| :diagtext:`with` |nbsp| |+--------------------------------------------------------+| |nbsp| :diagtext:`is always` |nbsp| :placeholder:`E`| +| ||+--------------------------------------------+|| ||+------------------------------------------------------+|| | +| |||:diagtext:`constant` |nbsp| :placeholder:`A`||| |||:diagtext:`expression of type` |nbsp| :placeholder:`C`||| | +| ||+--------------------------------------------+|| ||+------------------------------------------------------+|| | +| |+----------------------------------------------+| |+--------------------------------------------------------+| | +| ||:diagtext:`true` || ||:diagtext:`boolean expression` || | +| |+----------------------------------------------+| |+--------------------------------------------------------+| | +| ||:diagtext:`false` || | | | +| |+----------------------------------------------+| | | | ++----------------------------------------------------------------------+------------------------------------------------+--------------------------------+----------------------------------------------------------+-----------------------------------------------------+ -Wtautological-overlap-compare ------------------------------ **Diagnostic text:** +-----------------------------------------------------------------------------------------+-------------------+ |:warning:`warning:` |nbsp| :diagtext:`overlapping comparisons always evaluate to` |nbsp| |+-----------------+| | ||:diagtext:`false`|| | |+-----------------+| | ||:diagtext:`true` || | |+-----------------+| +-----------------------------------------------------------------------------------------+-------------------+ -Wtautological-pointer-compare ------------------------------ This diagnostic is enabled by default. **Diagnostic text:** +--------------------------------------------------------------------+---------------------------+----------------------------------------------------------+-------------------------+----------------------------------------+-------------------+--------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`comparison of nonnull` |nbsp| |+-------------------------+| |nbsp| :diagtext:`'`:placeholder:`B`:diagtext:`'` |nbsp| |+-----------------------+|:diagtext:`equal to a null pointer is '`|+-----------------+|:diagtext:`' on first encounter`| | ||:diagtext:`function call`|| ||:diagtext:`not` |nbsp| || ||:diagtext:`true` || | | |+-------------------------+| |+-----------------------+| |+-----------------+| | | ||:diagtext:`parameter` || || || ||:diagtext:`false`|| | | |+-------------------------+| |+-----------------------+| |+-----------------+| | +--------------------------------------------------------------------+---------------------------+----------------------------------------------------------+-------------------------+----------------------------------------+-------------------+--------------------------------+ +------------------------------------------------------------+------------------------+----------------------------------------------------------+-------------------------+-----------------------------------------------------+-------------------+ |:warning:`warning:` |nbsp| :diagtext:`comparison of` |nbsp| |+----------------------+| |nbsp| :diagtext:`'`:placeholder:`B`:diagtext:`'` |nbsp| |+-----------------------+|:diagtext:`equal to a null pointer is always` |nbsp| |+-----------------+| | ||:diagtext:`address of`|| ||:diagtext:`not` |nbsp| || ||:diagtext:`true` || | |+----------------------+| |+-----------------------+| |+-----------------+| | ||:diagtext:`function` || || || ||:diagtext:`false`|| | |+----------------------+| |+-----------------------+| |+-----------------+| | ||:diagtext:`array` || | | | | | |+----------------------+| | | | | +------------------------------------------------------------+------------------------+----------------------------------------------------------+-------------------------+-----------------------------------------------------+-------------------+ +-Wtautological-type-limit-compare +--------------------------------- +**Diagnostic text:** + ++-------------------------------------------------------------------+------------------+--------------------------------+------------------+-----------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`result of comparison` |nbsp| |+----------------+| |nbsp| :placeholder:`C` |nbsp| |+----------------+| |nbsp| :diagtext:`is always` |nbsp| :placeholder:`E`| +| ||:placeholder:`D`|| ||:placeholder:`B`|| | +| |+----------------+| |+----------------+| | +| ||:placeholder:`B`|| ||:placeholder:`D`|| | +| |+----------------+| |+----------------+| | ++-------------------------------------------------------------------+------------------+--------------------------------+------------------+-----------------------------------------------------+ + + -Wtautological-undefined-compare -------------------------------- This diagnostic is enabled by default. **Diagnostic text:** +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------+ |:warning:`warning:` |nbsp| :diagtext:`reference cannot be bound to dereferenced null pointer in well-defined C++ code; comparison may be assumed to always evaluate to` |nbsp| |+-----------------+| | ||:diagtext:`true` || | |+-----------------+| | ||:diagtext:`false`|| | |+-----------------+| +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------+ +------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------+ |:warning:`warning:` |nbsp| :diagtext:`'this' pointer cannot be null in well-defined C++ code; comparison may be assumed to always evaluate to` |nbsp| |+-----------------+| | ||:diagtext:`true` || | |+-----------------+| | ||:diagtext:`false`|| | |+-----------------+| +------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------+ -Wtautological-unsigned-enum-zero-compare ----------------------------------------- -This diagnostic is enabled by default. - **Diagnostic text:** -+------------------------------------------------------------+--------------------------------------+--------------------------------+--------------------------------------+-------------------------------------+-------------------+ -|:warning:`warning:` |nbsp| :diagtext:`comparison of` |nbsp| |+------------------------------------+| |nbsp| :placeholder:`C` |nbsp| |+------------------------------------+| |nbsp| :diagtext:`is always` |nbsp| |+-----------------+| -| ||:placeholder:`D` || ||:diagtext:`unsigned enum expression`|| ||:diagtext:`false`|| -| |+------------------------------------+| |+------------------------------------+| |+-----------------+| -| ||:diagtext:`unsigned enum expression`|| ||:placeholder:`D` || ||:diagtext:`true` || -| |+------------------------------------+| |+------------------------------------+| |+-----------------+| -+------------------------------------------------------------+--------------------------------------+--------------------------------+--------------------------------------+-------------------------------------+-------------------+ ++----------------------------------------------------------------------+--------------------------------------+--------------------------------+--------------------------------------+-----------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`result of comparison of` |nbsp| |+------------------------------------+| |nbsp| :placeholder:`C` |nbsp| |+------------------------------------+| |nbsp| :diagtext:`is always` |nbsp| :placeholder:`E`| +| ||:placeholder:`D` || ||:diagtext:`unsigned enum expression`|| | +| |+------------------------------------+| |+------------------------------------+| | +| ||:diagtext:`unsigned enum expression`|| ||:placeholder:`D` || | +| |+------------------------------------+| |+------------------------------------+| | ++----------------------------------------------------------------------+--------------------------------------+--------------------------------+--------------------------------------+-----------------------------------------------------+ -Wtautological-unsigned-zero-compare ------------------------------------ -This diagnostic is enabled by default. - **Diagnostic text:** -+------------------------------------------------------------+---------------------------------+--------------------------------+---------------------------------+-------------------------------------+-------------------+ -|:warning:`warning:` |nbsp| :diagtext:`comparison of` |nbsp| |+-------------------------------+| |nbsp| :placeholder:`C` |nbsp| |+-------------------------------+| |nbsp| :diagtext:`is always` |nbsp| |+-----------------+| -| ||:placeholder:`D` || ||:diagtext:`unsigned expression`|| ||:diagtext:`false`|| -| |+-------------------------------+| |+-------------------------------+| |+-----------------+| -| ||:diagtext:`unsigned expression`|| ||:placeholder:`D` || ||:diagtext:`true` || -| |+-------------------------------+| |+-------------------------------+| |+-----------------+| -+------------------------------------------------------------+---------------------------------+--------------------------------+---------------------------------+-------------------------------------+-------------------+ ++----------------------------------------------------------------------+---------------------------------+--------------------------------+---------------------------------+-----------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`result of comparison of` |nbsp| |+-------------------------------+| |nbsp| :placeholder:`C` |nbsp| |+-------------------------------+| |nbsp| :diagtext:`is always` |nbsp| :placeholder:`E`| +| ||:placeholder:`D` || ||:diagtext:`unsigned expression`|| | +| |+-------------------------------+| |+-------------------------------+| | +| ||:diagtext:`unsigned expression`|| ||:placeholder:`D` || | +| |+-------------------------------+| |+-------------------------------+| | ++----------------------------------------------------------------------+---------------------------------+--------------------------------+---------------------------------+-----------------------------------------------------+ -Wtentative-definition-incomplete-type -------------------------------------- This diagnostic is enabled by default. **Diagnostic text:** +---------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`tentative definition of variable with internal linkage has incomplete non-array type` |nbsp| :placeholder:`A`| +---------------------------------------------------------------------------------------------------------------------------------------------------+ -Wthread-safety --------------- Controls `-Wthread-safety-analysis`_, `-Wthread-safety-attributes`_, `-Wthread-safety-precise`_, `-Wthread-safety-reference`_. -Wthread-safety-analysis ------------------------ **Diagnostic text:** +----------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`'`:placeholder:`B`:diagtext:`' must be acquired before '`:placeholder:`C`:diagtext:`'`| +----------------------------------------------------------------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`Cycle in acquired\_before/after dependencies, starting with '`:placeholder:`A`:diagtext:`'`| +---------------------------------------------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`cannot resolve lock expression`| +---------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`acquiring` |nbsp| :placeholder:`A` |nbsp| :diagtext:`'`:placeholder:`B`:diagtext:`' that is already held`| +-----------------------------------------------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`expecting` |nbsp| :placeholder:`A` |nbsp| :diagtext:`'`:placeholder:`B`:diagtext:`' to be held at start of each loop`| +-----------------------------------------------------------------------------------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`expecting` |nbsp| :placeholder:`A` |nbsp| :diagtext:`'`:placeholder:`B`:diagtext:`' to be held at the end of function`| +------------------------------------------------------------------------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`cannot call function '`:placeholder:`B`:diagtext:`' while` |nbsp| :placeholder:`A` |nbsp| :diagtext:`'`:placeholder:`C`:diagtext:`' is held`| +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -+---------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------+ -|:warning:`warning:` |nbsp| :diagtext:`calling function '`:placeholder:`B`:diagtext:`' requires holding` |nbsp| :placeholder:`A` |nbsp| |+--------------------------------------------------------+| -| ||+------------------------------------------+ || -| |||:diagtext:`'`:placeholder:`C`:diagtext:`'`| || -| ||+------------------------------------------+ || -| |+--------------------------------------------------------+| -| ||+------------------------------------------------------+|| -| |||:diagtext:`'`:placeholder:`C`:diagtext:`' exclusively`||| -| ||+------------------------------------------------------+|| -| |+--------------------------------------------------------+| -+---------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------+ ++---------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`calling function` |nbsp| :placeholder:`B` |nbsp| :diagtext:`requires holding` |nbsp| :placeholder:`A` |nbsp| |+--------------------------------------------------------+| +| ||+------------------------------------------+ || +| |||:diagtext:`'`:placeholder:`C`:diagtext:`'`| || +| ||+------------------------------------------+ || +| |+--------------------------------------------------------+| +| ||+------------------------------------------------------+|| +| |||:diagtext:`'`:placeholder:`C`:diagtext:`' exclusively`||| +| ||+------------------------------------------------------+|| +| |+--------------------------------------------------------+| ++---------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`'`:placeholder:`B`:diagtext:`' is acquired exclusively and shared in the same scope`| +--------------------------------------------------------------------------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`'`:placeholder:`B`:diagtext:`' is not held on every path through here`| +------------------------------------------------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`'`:placeholder:`B`:diagtext:`' is still held at the end of function`| +----------------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`releasing` |nbsp| :placeholder:`A` |nbsp| :diagtext:`'`:placeholder:`B`:diagtext:`' that was not held`| +--------------------------------------------------------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------------------------------------------+-----------------------+--------------------------------------------+-----------------------+--------------------------+ |:warning:`warning:` |nbsp| :diagtext:`releasing` |nbsp| :placeholder:`A` |nbsp| :diagtext:`'`:placeholder:`B`:diagtext:`' using` |nbsp| |+---------------------+| |nbsp| :diagtext:`access, expected` |nbsp| |+---------------------+| |nbsp| :diagtext:`access`| | ||:diagtext:`shared` || ||:diagtext:`shared` || | | |+---------------------+| |+---------------------+| | | ||:diagtext:`exclusive`|| ||:diagtext:`exclusive`|| | | |+---------------------+| |+---------------------+| | +----------------------------------------------------------------------------------------------------------------------------------------+-----------------------+--------------------------------------------+-----------------------+--------------------------+ -+---------------------------+---------------------+---------------------------------------------------------------------------------------------------+-----------------------------------+ -|:warning:`warning:` |nbsp| |+-------------------+| |nbsp| :diagtext:`the value pointed to by '`:placeholder:`A`:diagtext:`' requires holding` |nbsp| |+---------------------------------+| -| ||:diagtext:`reading`|| ||:diagtext:`any mutex` || -| |+-------------------+| |+---------------------------------+| -| ||:diagtext:`writing`|| ||:diagtext:`any mutex exclusively`|| -| |+-------------------+| |+---------------------------------+| -+---------------------------+---------------------+---------------------------------------------------------------------------------------------------+-----------------------------------+ ++---------------------------+---------------------+---------------------------------------------------------------------------------------------------------------+-----------------------------------+ +|:warning:`warning:` |nbsp| |+-------------------+| |nbsp| :diagtext:`the value pointed to by` |nbsp| :placeholder:`A` |nbsp| :diagtext:`requires holding` |nbsp| |+---------------------------------+| +| ||:diagtext:`reading`|| ||:diagtext:`any mutex` || +| |+-------------------+| |+---------------------------------+| +| ||:diagtext:`writing`|| ||:diagtext:`any mutex exclusively`|| +| |+-------------------+| |+---------------------------------+| ++---------------------------+---------------------+---------------------------------------------------------------------------------------------------------------+-----------------------------------+ -+---------------------------+---------------------+---------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------+ -|:warning:`warning:` |nbsp| |+-------------------+| |nbsp| :diagtext:`the value pointed to by '`:placeholder:`B`:diagtext:`' requires holding` |nbsp| :placeholder:`A` |nbsp| |+--------------------------------------------------------+| -| ||:diagtext:`reading`|| ||+------------------------------------------+ || -| |+-------------------+| |||:diagtext:`'`:placeholder:`C`:diagtext:`'`| || -| ||:diagtext:`writing`|| ||+------------------------------------------+ || -| |+-------------------+| |+--------------------------------------------------------+| -| | | ||+------------------------------------------------------+|| -| | | |||:diagtext:`'`:placeholder:`C`:diagtext:`' exclusively`||| -| | | ||+------------------------------------------------------+|| -| | | |+--------------------------------------------------------+| -+---------------------------+---------------------+---------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------+ ++---------------------------+---------------------+---------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------+ +|:warning:`warning:` |nbsp| |+-------------------+| |nbsp| :diagtext:`the value pointed to by` |nbsp| :placeholder:`B` |nbsp| :diagtext:`requires holding` |nbsp| :placeholder:`A` |nbsp| |+--------------------------------------------------------+| +| ||:diagtext:`reading`|| ||+------------------------------------------+ || +| |+-------------------+| |||:diagtext:`'`:placeholder:`C`:diagtext:`'`| || +| ||:diagtext:`writing`|| ||+------------------------------------------+ || +| |+-------------------+| |+--------------------------------------------------------+| +| | | ||+------------------------------------------------------+|| +| | | |||:diagtext:`'`:placeholder:`C`:diagtext:`' exclusively`||| +| | | ||+------------------------------------------------------+|| +| | | |+--------------------------------------------------------+| ++---------------------------+---------------------+---------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------+ -+---------------------------+---------------------+------------------------------------------------------------------------------------+-----------------------------------+ -|:warning:`warning:` |nbsp| |+-------------------+| |nbsp| :diagtext:`variable '`:placeholder:`A`:diagtext:`' requires holding` |nbsp| |+---------------------------------+| -| ||:diagtext:`reading`|| ||:diagtext:`any mutex` || -| |+-------------------+| |+---------------------------------+| -| ||:diagtext:`writing`|| ||:diagtext:`any mutex exclusively`|| -| |+-------------------+| |+---------------------------------+| -+---------------------------+---------------------+------------------------------------------------------------------------------------+-----------------------------------+ ++---------------------------+---------------------+------------------------------------------------------------------------------------------------+-----------------------------------+ +|:warning:`warning:` |nbsp| |+-------------------+| |nbsp| :diagtext:`variable` |nbsp| :placeholder:`A` |nbsp| :diagtext:`requires holding` |nbsp| |+---------------------------------+| +| ||:diagtext:`reading`|| ||:diagtext:`any mutex` || +| |+-------------------+| |+---------------------------------+| +| ||:diagtext:`writing`|| ||:diagtext:`any mutex exclusively`|| +| |+-------------------+| |+---------------------------------+| ++---------------------------+---------------------+------------------------------------------------------------------------------------------------+-----------------------------------+ -+---------------------------+---------------------+------------------------------------------------------------------------------------------------------------+----------------------------------------------------------+ -|:warning:`warning:` |nbsp| |+-------------------+| |nbsp| :diagtext:`variable '`:placeholder:`B`:diagtext:`' requires holding` |nbsp| :placeholder:`A` |nbsp| |+--------------------------------------------------------+| -| ||:diagtext:`reading`|| ||+------------------------------------------+ || -| |+-------------------+| |||:diagtext:`'`:placeholder:`C`:diagtext:`'`| || -| ||:diagtext:`writing`|| ||+------------------------------------------+ || -| |+-------------------+| |+--------------------------------------------------------+| -| | | ||+------------------------------------------------------+|| -| | | |||:diagtext:`'`:placeholder:`C`:diagtext:`' exclusively`||| -| | | ||+------------------------------------------------------+|| -| | | |+--------------------------------------------------------+| -+---------------------------+---------------------+------------------------------------------------------------------------------------------------------------+----------------------------------------------------------+ ++---------------------------+---------------------+------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------+ +|:warning:`warning:` |nbsp| |+-------------------+| |nbsp| :diagtext:`variable` |nbsp| :placeholder:`B` |nbsp| :diagtext:`requires holding` |nbsp| :placeholder:`A` |nbsp| |+--------------------------------------------------------+| +| ||:diagtext:`reading`|| ||+------------------------------------------+ || +| |+-------------------+| |||:diagtext:`'`:placeholder:`C`:diagtext:`'`| || +| ||:diagtext:`writing`|| ||+------------------------------------------+ || +| |+-------------------+| |+--------------------------------------------------------+| +| | | ||+------------------------------------------------------+|| +| | | |||:diagtext:`'`:placeholder:`C`:diagtext:`' exclusively`||| +| | | ||+------------------------------------------------------+|| +| | | |+--------------------------------------------------------+| ++---------------------------+---------------------+------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------+ -Wthread-safety-attributes -------------------------- **Diagnostic text:** +----------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`invalid capability name '`:placeholder:`A`:diagtext:`'; capability name must be 'mutex' or 'role'`| +----------------------------------------------------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`attribute requires arguments whose type is annotated with 'capability' attribute; type here is` |nbsp| :placeholder:`B`| +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`attribute can only be applied in a context annotated with 'capability("mutex")' attribute`| +--------------------------------------------------------------------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`only applies to pointer types; type here is` |nbsp| :placeholder:`B`| +----------------------------------------------------------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`ignoring` |nbsp| :placeholder:`A` |nbsp| :diagtext:`attribute because its argument is invalid`| +------------------------------------------------------------------------------------------------------------------------------------+ -Wthread-safety-beta -------------------- **Diagnostic text:** +------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`Thread safety beta warning.`| +------------------------------------------------------------------+ -Wthread-safety-negative ------------------------ **Diagnostic text:** +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`acquiring` |nbsp| :placeholder:`A` |nbsp| :diagtext:`'`:placeholder:`B`:diagtext:`' requires negative capability '`:placeholder:`C`:diagtext:`'`| +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wthread-safety-precise ----------------------- **Diagnostic text:** -+---------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------+ -|:warning:`warning:` |nbsp| :diagtext:`calling function '`:placeholder:`B`:diagtext:`' requires holding` |nbsp| :placeholder:`A` |nbsp| |+--------------------------------------------------------+| -| ||+------------------------------------------+ || -| |||:diagtext:`'`:placeholder:`C`:diagtext:`'`| || -| ||+------------------------------------------+ || -| |+--------------------------------------------------------+| -| ||+------------------------------------------------------+|| -| |||:diagtext:`'`:placeholder:`C`:diagtext:`' exclusively`||| -| ||+------------------------------------------------------+|| -| |+--------------------------------------------------------+| -+---------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------+ ++---------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`calling function` |nbsp| :placeholder:`B` |nbsp| :diagtext:`requires holding` |nbsp| :placeholder:`A` |nbsp| |+--------------------------------------------------------+| +| ||+------------------------------------------+ || +| |||:diagtext:`'`:placeholder:`C`:diagtext:`'`| || +| ||+------------------------------------------+ || +| |+--------------------------------------------------------+| +| ||+------------------------------------------------------+|| +| |||:diagtext:`'`:placeholder:`C`:diagtext:`' exclusively`||| +| ||+------------------------------------------------------+|| +| |+--------------------------------------------------------+| ++---------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------+ -+---------------------------+---------------------+---------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------+ -|:warning:`warning:` |nbsp| |+-------------------+| |nbsp| :diagtext:`the value pointed to by '`:placeholder:`B`:diagtext:`' requires holding` |nbsp| :placeholder:`A` |nbsp| |+--------------------------------------------------------+| -| ||:diagtext:`reading`|| ||+------------------------------------------+ || -| |+-------------------+| |||:diagtext:`'`:placeholder:`C`:diagtext:`'`| || -| ||:diagtext:`writing`|| ||+------------------------------------------+ || -| |+-------------------+| |+--------------------------------------------------------+| -| | | ||+------------------------------------------------------+|| -| | | |||:diagtext:`'`:placeholder:`C`:diagtext:`' exclusively`||| -| | | ||+------------------------------------------------------+|| -| | | |+--------------------------------------------------------+| -+---------------------------+---------------------+---------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------+ ++---------------------------+---------------------+---------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------+ +|:warning:`warning:` |nbsp| |+-------------------+| |nbsp| :diagtext:`the value pointed to by` |nbsp| :placeholder:`B` |nbsp| :diagtext:`requires holding` |nbsp| :placeholder:`A` |nbsp| |+--------------------------------------------------------+| +| ||:diagtext:`reading`|| ||+------------------------------------------+ || +| |+-------------------+| |||:diagtext:`'`:placeholder:`C`:diagtext:`'`| || +| ||:diagtext:`writing`|| ||+------------------------------------------+ || +| |+-------------------+| |+--------------------------------------------------------+| +| | | ||+------------------------------------------------------+|| +| | | |||:diagtext:`'`:placeholder:`C`:diagtext:`' exclusively`||| +| | | ||+------------------------------------------------------+|| +| | | |+--------------------------------------------------------+| ++---------------------------+---------------------+---------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------+ -+---------------------------+---------------------+------------------------------------------------------------------------------------------------------------+----------------------------------------------------------+ -|:warning:`warning:` |nbsp| |+-------------------+| |nbsp| :diagtext:`variable '`:placeholder:`B`:diagtext:`' requires holding` |nbsp| :placeholder:`A` |nbsp| |+--------------------------------------------------------+| -| ||:diagtext:`reading`|| ||+------------------------------------------+ || -| |+-------------------+| |||:diagtext:`'`:placeholder:`C`:diagtext:`'`| || -| ||:diagtext:`writing`|| ||+------------------------------------------+ || -| |+-------------------+| |+--------------------------------------------------------+| -| | | ||+------------------------------------------------------+|| -| | | |||:diagtext:`'`:placeholder:`C`:diagtext:`' exclusively`||| -| | | ||+------------------------------------------------------+|| -| | | |+--------------------------------------------------------+| -+---------------------------+---------------------+------------------------------------------------------------------------------------------------------------+----------------------------------------------------------+ ++---------------------------+---------------------+------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------+ +|:warning:`warning:` |nbsp| |+-------------------+| |nbsp| :diagtext:`variable` |nbsp| :placeholder:`B` |nbsp| :diagtext:`requires holding` |nbsp| :placeholder:`A` |nbsp| |+--------------------------------------------------------+| +| ||:diagtext:`reading`|| ||+------------------------------------------+ || +| |+-------------------+| |||:diagtext:`'`:placeholder:`C`:diagtext:`'`| || +| ||:diagtext:`writing`|| ||+------------------------------------------+ || +| |+-------------------+| |+--------------------------------------------------------+| +| | | ||+------------------------------------------------------+|| +| | | |||:diagtext:`'`:placeholder:`C`:diagtext:`' exclusively`||| +| | | ||+------------------------------------------------------+|| +| | | |+--------------------------------------------------------+| ++---------------------------+---------------------+------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------+ -Wthread-safety-reference ------------------------- **Diagnostic text:** -+----------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------+ -|:warning:`warning:` |nbsp| :diagtext:`passing variable '`:placeholder:`B`:diagtext:`' by reference requires holding` |nbsp| :placeholder:`A` |nbsp| |+--------------------------------------------------------+| -| ||+------------------------------------------+ || -| |||:diagtext:`'`:placeholder:`C`:diagtext:`'`| || -| ||+------------------------------------------+ || -| |+--------------------------------------------------------+| -| ||+------------------------------------------------------+|| -| |||:diagtext:`'`:placeholder:`C`:diagtext:`' exclusively`||| -| ||+------------------------------------------------------+|| -| |+--------------------------------------------------------+| -+----------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------+ ++----------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`passing variable` |nbsp| :placeholder:`B` |nbsp| :diagtext:`by reference requires holding` |nbsp| :placeholder:`A` |nbsp| |+--------------------------------------------------------+| +| ||+------------------------------------------+ || +| |||:diagtext:`'`:placeholder:`C`:diagtext:`'`| || +| ||+------------------------------------------+ || +| |+--------------------------------------------------------+| +| ||+------------------------------------------------------+|| +| |||:diagtext:`'`:placeholder:`C`:diagtext:`' exclusively`||| +| ||+------------------------------------------------------+|| +| |+--------------------------------------------------------+| ++----------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------+ -+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------+ -|:warning:`warning:` |nbsp| :diagtext:`passing the value that '`:placeholder:`B`:diagtext:`' points to by reference requires holding` |nbsp| :placeholder:`A` |nbsp| |+--------------------------------------------------------+| -| ||+------------------------------------------+ || -| |||:diagtext:`'`:placeholder:`C`:diagtext:`'`| || -| ||+------------------------------------------+ || -| |+--------------------------------------------------------+| -| ||+------------------------------------------------------+|| -| |||:diagtext:`'`:placeholder:`C`:diagtext:`' exclusively`||| -| ||+------------------------------------------------------+|| -| |+--------------------------------------------------------+| -+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------+ ++--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`passing the value that` |nbsp| :placeholder:`B` |nbsp| :diagtext:`points to by reference requires holding` |nbsp| :placeholder:`A` |nbsp| |+--------------------------------------------------------+| +| ||+------------------------------------------+ || +| |||:diagtext:`'`:placeholder:`C`:diagtext:`'`| || +| ||+------------------------------------------+ || +| |+--------------------------------------------------------+| +| ||+------------------------------------------------------+|| +| |||:diagtext:`'`:placeholder:`C`:diagtext:`' exclusively`||| +| ||+------------------------------------------------------+|| +| |+--------------------------------------------------------+| ++--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------+ -Wthread-safety-verbose ----------------------- **Diagnostic text:** +---------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`Thread safety verbose warning.`| +---------------------------------------------------------------------+ -Wtrigraphs ----------- This diagnostic is enabled by default. **Diagnostic text:** +-----------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`trigraph converted to '`:placeholder:`A`:diagtext:`' character`| +-----------------------------------------------------------------------------------------------------+ +------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`trigraph ends block comment`| +------------------------------------------------------------------+ +-------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`trigraph ignored`| +-------------------------------------------------------+ +-------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`ignored trigraph would end block comment`| +-------------------------------------------------------------------------------+ -Wtype-limits ------------- This diagnostic flag exists for GCC compatibility, and has no effect in Clang. -Wtype-safety ------------- This diagnostic is enabled by default. **Diagnostic text:** +----------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`specified` |nbsp| :placeholder:`A` |nbsp| :diagtext:`type tag requires a null pointer`| +----------------------------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`argument type` |nbsp| :placeholder:`A` |nbsp| :diagtext:`doesn't match specified` |nbsp| :placeholder:`B` |nbsp| :diagtext:`type tag` |nbsp| |+---------------------------------------------------+| | ||+-------------------------------------------------+|| | |||:diagtext:`that requires` |nbsp| :placeholder:`D`||| | ||+-------------------------------------------------+|| | |+---------------------------------------------------+| | || || | |+---------------------------------------------------+| +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------+ +---------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`this type tag was not designed to be used with this function`| +---------------------------------------------------------------------------------------------------+ -Wtypedef-redefinition ---------------------- This diagnostic is enabled by default. **Diagnostic text:** +--------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`redefinition of typedef` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is a C11 feature`| +--------------------------------------------------------------------------------------------------------------------------+ -Wtypename-missing ------------------ This diagnostic is enabled by default. **Diagnostic text:** +-------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`missing 'typename' prior to dependent type name '`:placeholder:`A`:placeholder:`B`:diagtext:`'`| +-------------------------------------------------------------------------------------------------------------------------------------+ -Wunable-to-open-stats-file --------------------------- This diagnostic is enabled by default. **Diagnostic text:** +-------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`unable to open statistics output file '`:placeholder:`A`:diagtext:`': '`:placeholder:`B`:diagtext:`'`| +-------------------------------------------------------------------------------------------------------------------------------------------+ -Wunavailable-declarations -------------------------- This diagnostic is enabled by default. **Diagnostic text:** +----------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`may be unavailable because the receiver type is unknown`| +----------------------------------------------------------------------------------------------------------------------+ -Wundeclared-selector --------------------- **Diagnostic text:** +----------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`undeclared selector` |nbsp| :placeholder:`A`| +----------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`undeclared selector` |nbsp| :placeholder:`A`:diagtext:`; did you mean` |nbsp| :placeholder:`B`:diagtext:`?`| +-------------------------------------------------------------------------------------------------------------------------------------------------+ -Wundef ------- **Diagnostic text:** +---------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is not defined, evaluates to 0`| +---------------------------------------------------------------------------------------------+ -Wundefined-bool-conversion --------------------------- This diagnostic is enabled by default. **Diagnostic text:** +------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`reference cannot be bound to dereferenced null pointer in well-defined C++ code; pointer may be assumed to always convert to true`| +------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'this' pointer cannot be null in well-defined C++ code; pointer may be assumed to always convert to true`| +-----------------------------------------------------------------------------------------------------------------------------------------------+ -Wundefined-func-template ------------------------- **Diagnostic text:** +---------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`instantiation of function` |nbsp| :placeholder:`A` |nbsp| :diagtext:`required here, but no definition is available`| +---------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wundefined-inline ------------------ This diagnostic is enabled by default. **Diagnostic text:** +----------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`inline function` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is not defined`| +----------------------------------------------------------------------------------------------------------------+ -Wundefined-internal -------------------- This diagnostic is enabled by default. **Diagnostic text:** +---------------------------+----------------------+-----------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| |+--------------------+| |nbsp| :placeholder:`B` |nbsp| :diagtext:`has internal linkage but is not defined`| | ||:diagtext:`function`|| | | |+--------------------+| | | ||:diagtext:`variable`|| | | |+--------------------+| | +---------------------------+----------------------+-----------------------------------------------------------------------------------+ -Wundefined-internal-type ------------------------- **Diagnostic text:** +---------------------------------------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`ISO C++ requires a definition in this translation unit for` |nbsp| |+--------------------+| |nbsp| :placeholder:`B` |nbsp| :diagtext:`because its type does not have linkage`| | ||:diagtext:`function`|| | | |+--------------------+| | | ||:diagtext:`variable`|| | | |+--------------------+| | +---------------------------------------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------------+ -Wundefined-reinterpret-cast ---------------------------- **Diagnostic text:** +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`dereference of type` |nbsp| :placeholder:`B` |nbsp| :diagtext:`that was reinterpret\_cast from type` |nbsp| :placeholder:`A` |nbsp| :diagtext:`has undefined behavior`| +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`reinterpret\_cast from` |nbsp| :placeholder:`A` |nbsp| :diagtext:`to` |nbsp| :placeholder:`B` |nbsp| :diagtext:`has undefined behavior`| +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wundefined-var-template ------------------------ This diagnostic is enabled by default. **Diagnostic text:** +---------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`instantiation of variable` |nbsp| :placeholder:`A` |nbsp| :diagtext:`required here, but no definition is available`| +---------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wunevaluated-expression ------------------------ This diagnostic is enabled by default. Also controls `-Wpotentially-evaluated-expression`_. **Diagnostic text:** +-----------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`expression with side effects has no effect in an unevaluated context`| +-----------------------------------------------------------------------------------------------------------+ -Wunguarded-availability ------------------------ Some of the diagnostics controlled by this flag are enabled by default. Also controls `-Wunguarded-availability-new`_. **Diagnostic text:** +---------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is only available on` |nbsp| :placeholder:`B` |nbsp| :placeholder:`C` |nbsp| :diagtext:`or newer`| +---------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wunguarded-availability-new ---------------------------- This diagnostic is enabled by default. **Diagnostic text:** +---------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is only available on` |nbsp| :placeholder:`B` |nbsp| :placeholder:`C` |nbsp| :diagtext:`or newer`| +---------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wunicode --------- This diagnostic is enabled by default. **Diagnostic text:** +-------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`incomplete universal character name; treating as '\\' followed by identifier`| +-------------------------------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`\\`:placeholder:`A` |nbsp| :diagtext:`used with no following hex digits; treating as '\\' followed by identifier`| +-------------------------------------------------------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`universal character name refers to a surrogate character`| +-----------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`universal character names are only valid in C99 or C++; treating as '\\' followed by identifier`| +--------------------------------------------------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`universal character names are only valid in C99 or C++`| +---------------------------------------------------------------------------------------------+ +-Wunicode-homoglyph +------------------- +This diagnostic is enabled by default. + +**Diagnostic text:** + ++-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`treating Unicode character as identifier character rather than as '`:placeholder:`B`:diagtext:`' symbol`| ++-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + + -Wunicode-whitespace -------------------- This diagnostic is enabled by default. **Diagnostic text:** +-------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`treating Unicode character as whitespace`| +-------------------------------------------------------------------------------+ -Wuninitialized --------------- Some of the diagnostics controlled by this flag are enabled by default. Also controls `-Wsometimes-uninitialized`_, `-Wstatic-self-init`_. **Diagnostic text:** +--------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`base class` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is uninitialized when used here to access` |nbsp| :placeholder:`B`| +--------------------------------------------------------------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`field` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is uninitialized when used here`| +-----------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`reference` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is not yet bound to a value when used here`| +--------------------------------------------------------------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`block pointer variable` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is uninitialized when captured by block`| +------------------------------------------------------------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`variable` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is uninitialized when used within its own initialization`| +---------------------------------------------------------------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`reference` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is not yet bound to a value when used within its own initialization`| +---------------------------------------------------------------------------------------------------------------------------------------------------------------+ +------------------------------------------------------------------------------------------------------------------------+-------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`variable` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is uninitialized when` |nbsp| |+-----------------------------+| | ||:diagtext:`used here` || | |+-----------------------------+| | ||:diagtext:`captured by block`|| | |+-----------------------------+| +------------------------------------------------------------------------------------------------------------------------+-------------------------------+ -Wunknown-argument ------------------ This diagnostic is enabled by default. **Diagnostic text:** +-----------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`unknown argument ignored in clang-cl: '`:placeholder:`A`:diagtext:`'`| +-----------------------------------------------------------------------------------------------------------+ ++---------------------------------------------------------------------------------------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`unknown argument ignored in clang-cl '`:placeholder:`A`:diagtext:`' (did you mean '`:placeholder:`B`:diagtext:`'?)`| ++---------------------------------------------------------------------------------------------------------------------------------------------------------+ + -Wunknown-attributes -------------------- This diagnostic is enabled by default. **Diagnostic text:** +-----------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`unknown attribute` |nbsp| :placeholder:`A` |nbsp| :diagtext:`ignored`| +-----------------------------------------------------------------------------------------------------------+ -Wunknown-escape-sequence ------------------------- This diagnostic is enabled by default. **Diagnostic text:** +-----------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`unknown escape sequence '\\`:placeholder:`A`:diagtext:`'`| +-----------------------------------------------------------------------------------------------+ -Wunknown-pragmas ----------------- Some of the diagnostics controlled by this flag are enabled by default. **Diagnostic text:** +------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`expected 'ON' or 'OFF' or 'DEFAULT' in pragma`| +------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`expected end of directive in pragma`| +--------------------------------------------------------------------------+ +-----------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`unknown pragma in STDC namespace`| +-----------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`pragma diagnostic pop could not pop, no matching push`| +--------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`pragma diagnostic expected 'error', 'warning', 'ignored', 'fatal', 'push', or 'pop'`| +--------------------------------------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`pragma diagnostic expected option name (e.g. "-Wundef")`| +----------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`unexpected token in pragma diagnostic`| +----------------------------------------------------------------------------+ +-------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`unknown pragma ignored`| +-------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`pragma include\_alias expected '`:placeholder:`A`:diagtext:`'`| +----------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`pragma include\_alias expected include filename`| +--------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`angle-bracketed include <`:placeholder:`A`:diagtext:`> cannot be aliased to double-quoted include "`:placeholder:`B`:diagtext:`"`| +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`double-quoted include "`:placeholder:`A`:diagtext:`" cannot be aliased to angle-bracketed include <`:placeholder:`B`:diagtext:`>`| +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`#pragma warning expected '`:placeholder:`A`:diagtext:`'`| +----------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`#pragma warning expected a warning number`| +--------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`#pragma warning(push, level) requires a level between 0 and 4`| +----------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`#pragma warning expected 'push', 'pop', 'default', 'disable', 'error', 'once', 'suppress', 1, 2, 3, or 4`| +-----------------------------------------------------------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`pragma STDC FENV\_ACCESS ON is not supported, ignoring pragma`| +----------------------------------------------------------------------------------------------------+ -Wunknown-sanitizers -------------------- This diagnostic is enabled by default. **Diagnostic text:** +-----------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`unknown sanitizer '`:placeholder:`A`:diagtext:`' ignored`| +-----------------------------------------------------------------------------------------------+ -Wunknown-warning-option ------------------------ This diagnostic is enabled by default. **Diagnostic text:** +----------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`unknown warning group '`:placeholder:`A`:diagtext:`', ignored`| +----------------------------------------------------------------------------------------------------+ +------------------------------------------------------+---------------------+---------------------------------------------------------+--------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`unknown` |nbsp| |+-------------------+| |nbsp| :diagtext:`option '`:placeholder:`B`:diagtext:`'`|+------------------------------------------------------------+| | ||:diagtext:`warning`|| || || | |+-------------------+| |+------------------------------------------------------------+| | ||:diagtext:`remark` || ||+----------------------------------------------------------+|| | |+-------------------+| |||:diagtext:`; did you mean '`:placeholder:`D`:diagtext:`'?`||| | | | ||+----------------------------------------------------------+|| | | | |+------------------------------------------------------------+| +------------------------------------------------------+---------------------+---------------------------------------------------------+--------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`unknown` |nbsp| :placeholder:`A` |nbsp| :diagtext:`warning specifier: '`:placeholder:`B`:diagtext:`'`| +-------------------------------------------------------------------------------------------------------------------------------------------+ -Wunnamed-type-template-args ---------------------------- Some of the diagnostics controlled by this flag are enabled by default. Also controls `-Wc++98-compat-unnamed-type-template-args`_. **Diagnostic text:** +--------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`template argument uses unnamed type`| +--------------------------------------------------------------------------+ -Wunneeded-internal-declaration ------------------------------- **Diagnostic text:** +---------------------------+----------------------+---------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| |+--------------------+| |nbsp| :placeholder:`B` |nbsp| :diagtext:`is not needed and will not be emitted`| | ||:diagtext:`function`|| | | |+--------------------+| | | ||:diagtext:`variable`|| | | |+--------------------+| | +---------------------------+----------------------+---------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'static' function` |nbsp| :placeholder:`A` |nbsp| :diagtext:`declared in header file should be declared 'static inline'`| +--------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wunneeded-member-function -------------------------- **Diagnostic text:** +---------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`member function` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is not needed and will not be emitted`| +---------------------------------------------------------------------------------------------------------------------------------------+ -Wunreachable-code ------------------ Also controls `-Wunreachable-code-loop-increment`_. **Diagnostic text:** +------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`code will never be executed`| +------------------------------------------------------------------+ -Wunreachable-code-aggressive ----------------------------- Controls `-Wunreachable-code`_, `-Wunreachable-code-break`_, `-Wunreachable-code-return`_. -Wunreachable-code-break ------------------------ **Diagnostic text:** +---------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'break' will never be executed`| +---------------------------------------------------------------------+ -Wunreachable-code-loop-increment --------------------------------- **Diagnostic text:** +-------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`loop will run at most once (loop increment never executed)`| +-------------------------------------------------------------------------------------------------+ -Wunreachable-code-return ------------------------- **Diagnostic text:** +----------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`'return' will never be executed`| +----------------------------------------------------------------------+ -Wunsequenced ------------- This diagnostic is enabled by default. **Diagnostic text:** +----------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`multiple unsequenced modifications to` |nbsp| :placeholder:`A`| +----------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`unsequenced modification and access to` |nbsp| :placeholder:`A`| +-----------------------------------------------------------------------------------------------------+ -Wunsupported-abs ----------------- This diagnostic is enabled by default. **Diagnostic text:** +-----------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`ignoring '-mabs=2008' option because the '`:placeholder:`A`:diagtext:`' architecture does not support it`| +-----------------------------------------------------------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`ignoring '-mabs=legacy' option because the '`:placeholder:`A`:diagtext:`' architecture does not support it`| +-------------------------------------------------------------------------------------------------------------------------------------------------+ -Wunsupported-availability-guard -------------------------------- This diagnostic is enabled by default. **Diagnostic text:** +---------------------------+------------------------------------+--------------------------------------------------------------+------------------------------------+---------------------+ |:warning:`warning:` |nbsp| |+----------------------------------+| |nbsp| :diagtext:`does not guard availability here; use if (`|+----------------------------------+|:diagtext:`) instead`| | ||:diagtext:`@available` || ||:diagtext:`@available` || | | |+----------------------------------+| |+----------------------------------+| | | ||:diagtext:`\_\_builtin\_available`|| ||:diagtext:`\_\_builtin\_available`|| | | |+----------------------------------+| |+----------------------------------+| | +---------------------------+------------------------------------+--------------------------------------------------------------+------------------------------------+---------------------+ -Wunsupported-cb ---------------- This diagnostic is enabled by default. **Diagnostic text:** +--------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`ignoring '-mcompact-branches=' option because the '`:placeholder:`A`:diagtext:`' architecture does not support it`| +--------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wunsupported-dll-base-class-template ------------------------------------- **Diagnostic text:** +---------------------------------------------------------------------------+------------------------------------+------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`propagating dll attribute to` |nbsp| |+----------------------------------+| |nbsp| :diagtext:`base class template without dll attribute is not supported`| | ||:diagtext:`already instantiated` || | | |+----------------------------------+| | | ||:diagtext:`explicitly specialized`|| | | |+----------------------------------+| | +---------------------------------------------------------------------------+------------------------------------+------------------------------------------------------------------------------+ -Wunsupported-friend -------------------- This diagnostic is enabled by default. **Diagnostic text:** +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`dependent nested name specifier '`:placeholder:`A`:diagtext:`' for friend template declaration is not supported; ignoring this friend declaration`| +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`dependent nested name specifier '`:placeholder:`A`:diagtext:`' for friend class declaration is not supported; turning off access control for` |nbsp| :placeholder:`B`| +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wunsupported-gpopt ------------------- This diagnostic is enabled by default. **Diagnostic text:** +--------------------------------------------------------------------------------------------------+-------------------------------------------+----------------------+ |:warning:`warning:` |nbsp| :diagtext:`ignoring '-mgpopt' option as it cannot be used with` |nbsp| |+-----------------------------------------+|:diagtext:`-mabicalls`| | || || | | |+-----------------------------------------+| | | ||:diagtext:`the implicit usage of` |nbsp| || | | |+-----------------------------------------+| | +--------------------------------------------------------------------------------------------------+-------------------------------------------+----------------------+ -Wunsupported-nan ----------------- This diagnostic is enabled by default. **Diagnostic text:** +-----------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`ignoring '-mnan=2008' option because the '`:placeholder:`A`:diagtext:`' architecture does not support it`| +-----------------------------------------------------------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`ignoring '-mnan=legacy' option because the '`:placeholder:`A`:diagtext:`' architecture does not support it`| +-------------------------------------------------------------------------------------------------------------------------------------------------+ +-Wunsupported-target-opt +------------------------ +This diagnostic is enabled by default. + +**Diagnostic text:** + ++---------------------------------------------------------------------------------------------------------------------------------------------------------+ +|:warning:`warning:` |nbsp| :diagtext:`debug information option '`:placeholder:`A`:diagtext:`' is not supported for target '`:placeholder:`B`:diagtext:`'`| ++---------------------------------------------------------------------------------------------------------------------------------------------------------+ + + -Wunsupported-visibility ------------------------ This diagnostic is enabled by default. **Diagnostic text:** +------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`target does not support 'protected' visibility; using 'default'`| +------------------------------------------------------------------------------------------------------+ -Wunusable-partial-specialization --------------------------------- This diagnostic is an error by default, but the flag ``-Wno-unusable-partial-specialization`` can be used to disable the error. **Diagnostic text:** +-----------------------+----------------------+--------------------------------------------------------------------+----------------------------------+------------------------------------------------------------------------------------------+ |:error:`error:` |nbsp| |+--------------------+| |nbsp| :diagtext:`template partial specialization contains` |nbsp| |+--------------------------------+| |nbsp| :diagtext:`that cannot be deduced; this partial specialization will never be used`| | ||:diagtext:`class` || ||:diagtext:`a template parameter`|| | | |+--------------------+| |+--------------------------------+| | | ||:diagtext:`variable`|| ||:diagtext:`template parameters` || | | |+--------------------+| |+--------------------------------+| | +-----------------------+----------------------+--------------------------------------------------------------------+----------------------------------+------------------------------------------------------------------------------------------+ -Wunused -------- Some of the diagnostics controlled by this flag are enabled by default. Controls `-Wunused-argument`_, `-Wunused-function`_, `-Wunused-label`_, `-Wunused-lambda-capture`_, `-Wunused-local-typedef`_, `-Wunused-private-field`_, `-Wunused-property-ivar`_, `-Wunused-value`_, `-Wunused-variable`_. -Wunused-argument ----------------- This diagnostic flag exists for GCC compatibility, and has no effect in Clang. -Wunused-command-line-argument ------------------------------ This diagnostic is enabled by default. **Diagnostic text:** +-------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`argument '`:placeholder:`A`:diagtext:`' requires profile-guided optimization information`| +-------------------------------------------------------------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`joined argument expects additional value: '`:placeholder:`A`:diagtext:`'`| +---------------------------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------+----------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A`:diagtext:`: '`:placeholder:`B`:diagtext:`' input unused`|+--------------------------------------------------------------------+| | ||+------------------------------------------------------------------+|| | ||| |nbsp| :diagtext:`when '`:placeholder:`D`:diagtext:`' is present`||| | ||+------------------------------------------------------------------+|| | |+--------------------------------------------------------------------+| | || || | |+--------------------------------------------------------------------+| +----------------------------------------------------------------------------------------------------+----------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A`:diagtext:`: '`:placeholder:`B`:diagtext:`' input unused in cpp mode`| +----------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------+-----------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A`:diagtext:`: previously preprocessed input`|+---------------------------------------------------------------------------+| | ||+-------------------------------------------------------------------------+|| | ||| |nbsp| :diagtext:`unused when '`:placeholder:`C`:diagtext:`' is present`||| | ||+-------------------------------------------------------------------------+|| | |+---------------------------------------------------------------------------+| | || || | |+---------------------------------------------------------------------------+| +--------------------------------------------------------------------------------------+-----------------------------------------------------------------------------+ +---------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`argument unused during compilation: '`:placeholder:`A`:diagtext:`'`| +---------------------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`the flag '`:placeholder:`A`:diagtext:`' has been deprecated and will be ignored`| +----------------------------------------------------------------------------------------------------------------------+ -Wunused-comparison ------------------- This diagnostic is enabled by default. **Diagnostic text:** -+---------------------------+-----------------------------------------+--------------------------------------------+ -|:warning:`warning:` |nbsp| |+---------------------------------------+| |nbsp| :diagtext:`comparison result unused`| -| ||+----------------+--------------------+|| | -| |||+--------------+|:diagtext:`equality`||| | -| |||| || ||| | -| |||+--------------+| ||| | -| ||||:diagtext:`in`|| ||| | -| |||+--------------+| ||| | -| ||+----------------+--------------------+|| | -| |+---------------------------------------+| | -| ||:diagtext:`relational` || | -| |+---------------------------------------+| | -+---------------------------+-----------------------------------------+--------------------------------------------+ ++---------------------------+------------------------+--------------------------------------------+ +|:warning:`warning:` |nbsp| |+----------------------+| |nbsp| :diagtext:`comparison result unused`| +| ||:diagtext:`equality` || | +| |+----------------------+| | +| ||:diagtext:`inequality`|| | +| |+----------------------+| | +| ||:diagtext:`relational`|| | +| |+----------------------+| | +| ||:diagtext:`three-way` || | +| |+----------------------+| | ++---------------------------+------------------------+--------------------------------------------+ -Wunused-const-variable ----------------------- **Diagnostic text:** +------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`unused variable` |nbsp| :placeholder:`A`| +------------------------------------------------------------------------------+ -Wunused-exception-parameter ---------------------------- **Diagnostic text:** +-----------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`unused exception parameter` |nbsp| :placeholder:`A`| +-----------------------------------------------------------------------------------------+ -Wunused-function ----------------- Also controls `-Wunneeded-internal-declaration`_. **Diagnostic text:** +------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`unused function` |nbsp| :placeholder:`A`| +------------------------------------------------------------------------------+ -Wunused-getter-return-value ---------------------------- This diagnostic is enabled by default. **Diagnostic text:** +------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`property access result unused - getters should not be used for side effects`| +------------------------------------------------------------------------------------------------------------------+ -Wunused-label -------------- **Diagnostic text:** +---------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`unused label` |nbsp| :placeholder:`A`| +---------------------------------------------------------------------------+ -Wunused-lambda-capture ----------------------- **Diagnostic text:** +---------------------------------------------------------------------------------------------------------------+--------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`lambda capture` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is not` |nbsp| |+------------------------------------------------+| | ||:diagtext:`used` || | |+------------------------------------------------+| | ||:diagtext:`required to be captured for this use`|| | |+------------------------------------------------+| +---------------------------------------------------------------------------------------------------------------+--------------------------------------------------+ -Wunused-local-typedef ---------------------- **Diagnostic text:** +-----------------------------------------------------+------------------------+------------------------+ |:warning:`warning:` |nbsp| :diagtext:`unused` |nbsp| |+----------------------+| |nbsp| :placeholder:`B`| | ||:diagtext:`typedef` || | | |+----------------------+| | | ||:diagtext:`type alias`|| | | |+----------------------+| | +-----------------------------------------------------+------------------------+------------------------+ -Wunused-local-typedefs ----------------------- Synonym for `-Wunused-local-typedef`_. -Wunused-macros --------------- **Diagnostic text:** +--------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`macro is not used`| +--------------------------------------------------------+ -Wunused-member-function ------------------------ Also controls `-Wunneeded-member-function`_. **Diagnostic text:** +-------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`unused member function` |nbsp| :placeholder:`A`| +-------------------------------------------------------------------------------------+ -Wunused-parameter ------------------ **Diagnostic text:** +-------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`unused parameter` |nbsp| :placeholder:`A`| +-------------------------------------------------------------------------------+ -Wunused-private-field ---------------------- **Diagnostic text:** +-----------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`private field` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is not used`| +-----------------------------------------------------------------------------------------------------------+ -Wunused-property-ivar ---------------------- **Diagnostic text:** +-------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`ivar` |nbsp| :placeholder:`A` |nbsp| :diagtext:`which backs the property is not referenced in this property's accessor`| +-------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wunused-result --------------- This diagnostic is enabled by default. **Diagnostic text:** +-------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`ignoring return value of function declared with` |nbsp| :placeholder:`A` |nbsp| :diagtext:`attribute`| +-------------------------------------------------------------------------------------------------------------------------------------------+ -Wunused-template ----------------- Also controls `-Wunneeded-internal-declaration`_. **Diagnostic text:** +-----------------------------------------------------+----------------------+----------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`unused` |nbsp| |+--------------------+| |nbsp| :diagtext:`template` |nbsp| :placeholder:`B`| | ||:diagtext:`function`|| | | |+--------------------+| | | ||:diagtext:`variable`|| | | |+--------------------+| | +-----------------------------------------------------+----------------------+----------------------------------------------------+ -Wunused-value -------------- This diagnostic is enabled by default. Also controls `-Wunevaluated-expression`_, `-Wunused-comparison`_, `-Wunused-result`_. **Diagnostic text:** +-------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`ignoring return value of function declared with` |nbsp| :placeholder:`A` |nbsp| :diagtext:`attribute`| +-------------------------------------------------------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`container access result unused - container access should not be used for side effects`| +----------------------------------------------------------------------------------------------------------------------------+ +---------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`expression result unused`| +---------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`expression result unused; should this cast be to 'void'?`| +-----------------------------------------------------------------------------------------------+ -Wunused-variable ----------------- Also controls `-Wunused-const-variable`_. **Diagnostic text:** +------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`unused variable` |nbsp| :placeholder:`A`| +------------------------------------------------------------------------------+ -Wunused-volatile-lvalue ------------------------ This diagnostic is enabled by default. **Diagnostic text:** +----------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`expression result unused; assign into a variable to force a volatile load`| +----------------------------------------------------------------------------------------------------------------+ -Wused-but-marked-unused ------------------------ **Diagnostic text:** +---------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`was marked unused but was used`| +---------------------------------------------------------------------------------------------+ -Wuser-defined-literals ----------------------- This diagnostic is enabled by default. **Diagnostic text:** +--------------------------------------------------------------------------------------------------------+----------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`user-defined literal suffixes not starting with '\_' are reserved`|+--------------------------------------------------+| | ||:diagtext:`; no literal will invoke this operator`|| | |+--------------------------------------------------+| | || || | |+--------------------------------------------------+| +--------------------------------------------------------------------------------------------------------+----------------------------------------------------+ -Wuser-defined-warnings ----------------------- This diagnostic is enabled by default. **Diagnostic text:** The text of this diagnostic is not controlled by Clang. -Wvarargs --------- This diagnostic is enabled by default. **Diagnostic text:** +-----------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`second argument to 'va\_start' is not the last named parameter`| +-----------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`second argument to 'va\_arg' is of promotable type` |nbsp| :placeholder:`A`:diagtext:`; this va\_arg has undefined behavior because arguments will be promoted to` |nbsp| :placeholder:`B`| +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +------------------------------------------------------+-----------------------------------------------------------------+---------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`passing` |nbsp| |+---------------------------------------------------------------+| |nbsp| :diagtext:`to 'va\_start' has undefined behavior`| | ||:diagtext:`an object that undergoes default argument promotion`|| | | |+---------------------------------------------------------------+| | | ||:diagtext:`an object of reference type` || | | |+---------------------------------------------------------------+| | | ||:diagtext:`a parameter declared with the 'register' keyword` || | | |+---------------------------------------------------------------+| | +------------------------------------------------------+-----------------------------------------------------------------+---------------------------------------------------------+ -Wvariadic-macros ----------------- Some of the diagnostics controlled by this flag are enabled by default. **Diagnostic text:** +--------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`named variadic macros are a GNU extension`| +--------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`\_\_VA\_OPT\_\_ can only appear in the expansion of a variadic macro`| +-----------------------------------------------------------------------------------------------------------+ +------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`variadic macros are a C99 feature`| +------------------------------------------------------------------------+ -Wvec-elem-size --------------- This diagnostic is an error by default, but the flag ``-Wno-vec-elem-size`` can be used to disable the error. **Diagnostic text:** +--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:error:`error:` |nbsp| :diagtext:`vector operands do not have the same elements sizes (`:placeholder:`A` |nbsp| :diagtext:`and` |nbsp| :placeholder:`B`:diagtext:`)`| +--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wvector-conversion ------------------- **Diagnostic text:** +------------------------------------------------------------------------+----------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`incompatible vector types` |nbsp| |+--------------------------------------------------------------+| | ||:diagtext:`assigning to different types` || | |+--------------------------------------------------------------+| | ||:diagtext:`passing to parameter of different type` || | |+--------------------------------------------------------------+| | ||:diagtext:`returning from function with different return type`|| | |+--------------------------------------------------------------+| | ||:diagtext:`converting between types` || | |+--------------------------------------------------------------+| | ||:diagtext:`initializing with expression of different type` || | |+--------------------------------------------------------------+| | ||:diagtext:`sending to parameter of different type` || | |+--------------------------------------------------------------+| | ||:diagtext:`casting between types` || | |+--------------------------------------------------------------+| +------------------------------------------------------------------------+----------------------------------------------------------------+ -Wvector-conversions -------------------- Synonym for `-Wvector-conversion`_. -Wvexing-parse -------------- This diagnostic is enabled by default. **Diagnostic text:** +----------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`empty parentheses interpreted as a function declaration`| +----------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`parentheses were disambiguated as a function declaration`| +-----------------------------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`parentheses were disambiguated as redundant parentheses around declaration of variable named` |nbsp| :placeholder:`A`| +-----------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wvisibility ------------ This diagnostic is enabled by default. **Diagnostic text:** +---------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`declaration of` |nbsp| :placeholder:`A` |nbsp| :diagtext:`will not be visible outside of this function`| +---------------------------------------------------------------------------------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`redefinition of` |nbsp| :placeholder:`A` |nbsp| :diagtext:`will not be visible outside of this function`| +----------------------------------------------------------------------------------------------------------------------------------------------+ -Wvla ----- **Diagnostic text:** +-----------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`variable length array used`| +-----------------------------------------------------------------+ -Wvla-extension --------------- **Diagnostic text:** +-------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`variable length arrays are a C99 feature`| +-------------------------------------------------------------------------------+ -Wvoid-ptr-dereference ---------------------- This diagnostic is enabled by default. **Diagnostic text:** +--------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`ISO C++ does not allow indirection on operand of type` |nbsp| :placeholder:`A`| +--------------------------------------------------------------------------------------------------------------------+ -Wvolatile-register-var ----------------------- This diagnostic flag exists for GCC compatibility, and has no effect in Clang. -Wweak-template-vtables ----------------------- **Diagnostic text:** +--------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`explicit template instantiation` |nbsp| :placeholder:`A` |nbsp| :diagtext:`will emit a vtable in every translation unit`| +--------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wweak-vtables -------------- **Diagnostic text:** +------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`has no out-of-line virtual method definitions; its vtable will be emitted in every translation unit`| +------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Wwritable-strings ------------------ This diagnostic is enabled by default. Also controls `-Wdeprecated-writable-strings`_. **Diagnostic text:** +-------------------------------------------------------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`ISO C++11 does not allow conversion from string literal to` |nbsp| :placeholder:`A`| +-------------------------------------------------------------------------------------------------------------------------+ -Wwrite-strings --------------- Synonym for `-Wwritable-strings`_. -Wzero-as-null-pointer-constant ------------------------------- **Diagnostic text:** +--------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`zero as null pointer constant`| +--------------------------------------------------------------------+ -Wzero-length-array ------------------- **Diagnostic text:** +------------------------------------------------------------------------+ |:warning:`warning:` |nbsp| :diagtext:`zero size arrays are an extension`| +------------------------------------------------------------------------+ Index: vendor/clang/dist-release_70/docs/ReleaseNotes.rst =================================================================== --- vendor/clang/dist-release_70/docs/ReleaseNotes.rst (revision 338576) +++ vendor/clang/dist-release_70/docs/ReleaseNotes.rst (revision 338577) @@ -1,385 +1,334 @@ -======================================= -Clang 7.0.0 (In-Progress) Release Notes -======================================= +========================= +Clang 7.0.0 Release Notes +========================= .. contents:: :local: :depth: 2 -Written by the `LLVM Team `_ +Written by the `LLVM Team `_ -.. warning:: - - These are in-progress notes for the upcoming Clang 7 release. - Release notes for previous releases can be found on - `the Download Page `_. - Introduction ============ This document contains the release notes for the Clang C/C++/Objective-C frontend, part of the LLVM Compiler Infrastructure, release 7.0.0. Here we describe the status of Clang in some detail, including major improvements from the previous release and new feature work. For the general LLVM release notes, see `the LLVM -documentation `_. All LLVM +documentation `_. All LLVM releases may be downloaded from the `LLVM releases web -site `_. +site `_. For more information about Clang or LLVM, including information about the -latest release, please see the `Clang Web Site `_ or the -`LLVM Web Site `_. +latest release, please see the `Clang Web Site `_ or the +`LLVM Web Site `_. -Note that if you are reading this file from a Subversion checkout or the -main Clang web page, this document applies to the *next* release, not -the current one. To see the release notes for a specific release, please -see the `releases page `_. - What's New in Clang 7.0.0? ========================== Some of the major new features and improvements to Clang are listed here. Generic improvements to Clang as a whole or to its underlying infrastructure are described first, followed by language-specific sections with improvements to Clang's support for those languages. Major New Features ------------------ - A new Implicit Conversion Sanitizer (``-fsanitize=implicit-conversion``) group was added. Please refer to the :ref:`release-notes-ubsan` section of the release notes for the details. - Preliminary/experimental support for DWARF v5 debugging information. If you compile with ``-gdwarf-5 -O0`` you should get fully conforming DWARF v5 information, including the new .debug_names accelerator table. Type units and split DWARF are known not to conform, and higher optimization levels will likely get a mix of v4 and v5 formats. - + Improvements to Clang's diagnostics -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +----------------------------------- - ``-Wc++98-compat-extra-semi`` is a new flag, which was previously inseparable from ``-Wc++98-compat-pedantic``. The latter still controls the new flag. - ``-Wextra-semi`` now also controls ``-Wc++98-compat-extra-semi``. Please do note that if you pass ``-Wno-c++98-compat-pedantic``, it implies ``-Wno-c++98-compat-extra-semi``, so if you want that diagnostic, you need to explicitly re-enable it (e.g. by appending ``-Wextra-semi``). - ``-Wself-assign`` and ``-Wself-assign-field`` were extended to diagnose self-assignment operations using overloaded operators (i.e. classes). If you are doing such an assignment intentionally, e.g. in a unit test for a data structure, the first warning can be disabled by passing ``-Wno-self-assign-overloaded``, also the warning can be suppressed by adding ``*&`` to the right-hand side or casting it to the appropriate reference type. Non-comprehensive list of changes in this release ------------------------------------------------- - Clang binary and libraries have been renamed from 7.0 to 7. For example, the ``clang`` binary will be called ``clang-7`` instead of ``clang-7.0``. +- The optimization flag to merge constants (``-fmerge-all-constants``) is no + longer applied by default. + - Clang implements a collection of recent fixes to the C++ standard's definition of "standard-layout". In particular, a class is only considered to be standard-layout if all base classes and the first data member (or bit-field) can be laid out at offset zero. - Clang's handling of the GCC ``packed`` class attribute in C++ has been fixed to apply only to non-static data members and not to base classes. This fixes an ABI difference between Clang and GCC, but creates an ABI difference between Clang 7 and earlier versions. The old behavior can be restored by setting - ``-fclang-abi-compat`` to ``6`` or earlier. + ``-fclang-abi-compat`` to ``6`` or lower. - Clang implements the proposed resolution of LWG issue 2358, along with the `corresponding change to the Itanium C++ ABI `_, which make classes containing only unnamed non-zero-length bit-fields be considered non-empty. This is an ABI break compared to prior Clang releases, but makes Clang generate code that is ABI-compatible with other compilers. The old behavior can be restored by setting ``-fclang-abi-compat`` to ``6`` or lower. - An existing tool named ``diagtool`` has been added to the release. As the name suggests, it helps with dealing with diagnostics in ``clang``, such as finding out the warning hierarchy, and which of them are enabled by default or for a particular compiler invocation. - By default, Clang emits an address-significance table into every ELF object file when using the integrated assembler. Address-significance tables allow linkers to implement `safe ICF `_ without the false positives that can result from other implementation techniques such as relocation scanning. The ``-faddrsig`` and ``-fno-addrsig`` flags can be used to control whether to emit the address-significance table. -- ... +- The integrated assembler is enabled by default on OpenBSD / FreeBSD + for MIPS 64-bit targets. +- On MIPS FreeBSD, default CPUs have been changed to ``mips2`` + for 32-bit targets and ``mips3`` for 64-bit targets. + + New Compiler Flags ------------------ - ``-fstrict-float-cast-overflow`` and ``-fno-strict-float-cast-overflow``. - When a floating-point value is not representable in a destination integer - type, the code has undefined behavior according to the language standard. By + When converting a floating-point value to int and the value is not + representable in the destination integer type, + the code has undefined behavior according to the language standard. By default, Clang will not guarantee any particular result in that case. With the 'no-strict' option, Clang attempts to match the overflowing behavior of the target's native float-to-int conversion instructions. - ``-fforce-emit-vtables`` and ``-fno-force-emit-vtables``. - In order to improve devirtualization, forces emitting of vtables even in - modules where it isn't necessary. It causes more inline virtual functions - to be emitted. + In order to improve devirtualization, forces emission of vtables even in + modules where it isn't necessary. It causes more inline virtual functions + to be emitted. -- ... +- Added the ``-mcrc`` and ``-mno-crc`` flags to enable/disable using + of MIPS Cyclic Redundancy Check instructions. -Deprecated Compiler Flags -------------------------- +- Added the ``-mvirt`` and ``-mno-virt`` flags to enable/disable using + of MIPS Virtualization instructions. -The following options are deprecated and ignored. They will be removed in -future versions of Clang. +- Added the ``-mginv`` and ``-mno-ginv`` flags to enable/disable using + of MIPS Global INValidate instructions. -- ... Modified Compiler Flags ----------------------- -- Before Clang 7, we prepended the `#` character to the `--autocomplete` - argument to enable cc1 flags. For example, when the `-cc1` or `-Xclang` flag +- Before Clang 7, we prepended the `#` character to the ``--autocomplete`` + argument to enable cc1 flags. For example, when the ``-cc1`` or ``-Xclang`` flag is in the :program:`clang` invocation, the shell executed - `clang --autocomplete=#-`. Clang 7 now requires the - whole invocation including all flags to be passed to the `--autocomplete` like - this: `clang --autocomplete=-cc1,-xc++,-fsyn`. + ``clang --autocomplete=#-``. Clang 7 now requires the + whole invocation including all flags to be passed to the ``--autocomplete`` like + this: ``clang --autocomplete=-cc1,-xc++,-fsyn``. -New Pragmas in Clang --------------------- -Clang now supports the ... - - Attribute Changes in Clang -------------------------- - Clang now supports function multiversioning with attribute 'target' on ELF based x86/x86-64 environments by using indirect functions. This implementation has a few minor limitations over the GCC implementation for the sake of AST sanity, however it is otherwise compatible with existing code using this - feature for GCC. Consult the documentation for the target attribute for more - information. + feature for GCC. Consult the `documentation for the target attribute + `_ for more information. -- ... - Windows Support --------------- - clang-cl's support for precompiled headers has been much improved: - When using a pch file, clang-cl now no longer redundantly emits inline methods that are already stored in the obj that was built together with the pch file (matching cl.exe). This speeds up builds using pch files by around 30%. - - The /Ycfoo.h and /Yufoo.h flags can now be used without /FIfoo.h when - foo.h is instead included by an explicit `#include` directive. This means + - The ``/Ycfoo.h`` and ``/Yufoo.h`` flags can now be used without ``/FIfoo.h`` when + foo.h is instead included by an explicit ``#include`` directive. This means Visual Studio's default stdafx.h setup now uses precompiled headers with clang-cl. - The alternative entry point names (``wmain``/``WinMain``/``wWinMain``/``DllMain``) now are properly mangled as plain C names in C++ contexts when targeting MinGW, without having to explicit specify ``extern "C"``. (This was already the case for MSVC targets.) -- ... - -C Language Changes in Clang ---------------------------- - -- ... - -... - -C11 Feature Support -^^^^^^^^^^^^^^^^^^^ - -... - -C++ Language Changes in Clang ------------------------------ - -- ... - -C++1z Feature Support -^^^^^^^^^^^^^^^^^^^^^ - -... - Objective-C Language Changes in Clang ------------------------------------- -... +Clang now supports the GNUstep Objective-C ABI v2 on ELF platforms. This is +enabled with the ``-fobjc-runtime=gnustep-2.0`` flag. The new ABI is incompatible +with the older GNUstep ABIs, which were incremental changes on the old GCC ABI. +The new ABI provides richer reflection metadata and allows the linker to remove +duplicate selector and protocol definitions, giving smaller binaries. Windows +support for the new ABI is underway, but was not completed in time for the LLVM +7.0.0 release. OpenCL C/C++ Language Changes in Clang -------------------------------------- Miscellaneous changes in OpenCL C: - Added ``cles_khr_int64`` extension. - Added bug fixes and simplifications to Clang blocks in OpenCL mode. - Added compiler flag ``-cl-uniform-work-group-size`` to allow extra compile time optimisation. - Propagate ``denorms-are-zero`` attribute to IR if ``-cl-denorms-are-zero`` is passed to the compiler. - Separated ``read_only`` and ``write_only`` pipe IR types. - Fixed address space for the ``__func__`` predefined macro. - Improved diagnostics of kernel argument types. Started OpenCL C++ support: - Added ``-std/-cl-std=c++``. - Added support for keywords. OpenMP Support in Clang ---------------------------------- - Clang gained basic support for OpenMP 4.5 offloading for NVPTX target. - To compile your program for NVPTX target use the following options: - `-fopenmp -fopenmp-targets=nvptx64-nvidia-cuda` for 64 bit platforms or - `-fopenmp -fopenmp-targets=nvptx-nvidia-cuda` for 32 bit platform. + To compile your program for NVPTX target use the following options: + ``-fopenmp -fopenmp-targets=nvptx64-nvidia-cuda`` for 64 bit platforms or + ``-fopenmp -fopenmp-targets=nvptx-nvidia-cuda`` for 32 bit platform. + - Passing options to the OpenMP device offloading toolchain can be done using - the `-Xopenmp-target= -opt=val` flag. In this way the `-opt=val` + the ``-Xopenmp-target= -opt=val`` flag. In this way the ``-opt=val`` option will be forwarded to the respective OpenMP device offloading toolchain described by the triple. For example passing the compute capability to the OpenMP NVPTX offloading toolchain can be done as follows: - `-Xopenmp-target=nvptx64-nvidia-cuda -march=sm_60`. For the case when only one - target offload toolchain is specified under the `-fopenmp-targets=` - option, then the triple can be skipped: `-Xopenmp-target -march=sm_60`. + ``-Xopenmp-target=nvptx64-nvidia-cuda -march=sm_60``. For the case when only one + target offload toolchain is specified under the ``-fopenmp-targets=`` + option, then the triple can be skipped: ``-Xopenmp-target -march=sm_60``. - Other bugfixes. CUDA Support in Clang --------------------- - Clang will now try to locate the CUDA installation next to :program:`ptxas` in the `PATH` environment variable. This behavior can be turned off by passing - the new flag `--cuda-path-ignore-env`. + the new flag ``--cuda-path-ignore-env``. - Clang now supports generating object files with relocatable device code. This - feature needs to be enabled with `-fcuda-rdc` and my result in performance + feature needs to be enabled with ``-fcuda-rdc`` and may result in performance penalties compared to whole program compilation. Please note that NVIDIA's :program:`nvcc` must be used for linking. Internal API Changes -------------------- These are major API changes that have happened since the 6.0.0 release of Clang. If upgrading an external codebase that uses Clang as a library, this section should help get you past the largest hurdles of upgrading. -- The methods ``getLocStart``, ``getStartLoc`` and ``getLocEnd`` in the AST - classes are deprecated. New APIs ``getBeginLoc`` and ``getEndLoc`` should - be used instead. While the old methods remain in this release, they will +- The methods ``getLocStart``, ``getStartLoc`` and ``getLocEnd`` in the AST + classes are deprecated. New APIs ``getBeginLoc`` and ``getEndLoc`` should + be used instead. While the old methods remain in this release, they will not be present in the next release of Clang. -AST Matchers ------------- - -- ... - clang-format ------------ - Clang-format will now support detecting and formatting code snippets in raw - string literals. This is configured through the `RawStringFormats` style + string literals. This is configured through the ``RawStringFormats`` style option. -- ... - -libclang --------- - -... - - Static Analyzer --------------- -- The new `MmapWriteExec` checker had been introduced to detect attempts to map pages -both writable and executable. +- The new `MmapWriteExec` checker had been introduced to detect attempts to map pages both writable and executable. -... - .. _release-notes-ubsan: Undefined Behavior Sanitizer (UBSan) ------------------------------------ * A new Implicit Conversion Sanitizer (``-fsanitize=implicit-conversion``) group was added. Currently, only one type of issues is caught - implicit integer truncation (``-fsanitize=implicit-integer-truncation``), also known as integer demotion. While there is a ``-Wconversion`` diagnostic group that catches this kind of issues, it is both noisy, and does not catch **all** the cases. .. code-block:: c++ unsigned char store = 0; bool consume(unsigned int val); void test(unsigned long val) { if (consume(val)) // the value may have been silently truncated. store = store + 768; // before addition, 'store' was promoted to int. (void)consume((unsigned int)val); // OK, the truncation is explicit. } Just like other ``-fsanitize=integer`` checks, these issues are **not** undefined behaviour. But they are not *always* intentional, and are somewhat hard to track down. This group is **not** enabled by ``-fsanitize=undefined``, but the ``-fsanitize=implicit-integer-truncation`` check is enabled by ``-fsanitize=integer``. -Core Analysis Improvements -========================== -- ... +libc++ Changes +============== +Users that wish to link together translation units built with different +versions of libc++'s headers into the same final linked image should define the +`_LIBCPP_HIDE_FROM_ABI_PER_TU` macro to `1` when building those translation +units. In a future release, not defining `_LIBCPP_HIDE_FROM_ABI_PER_TU` to `1` +and linking translation units built with different versions of libc++'s headers +together may lead to ODR violations and ABI issues. -New Issues Found -================ -- ... - -Python Binding Changes ----------------------- - -The following methods have been added: - -- ... - -Significant Known Problems -========================== - Additional Information ====================== A wide variety of additional information is available on the `Clang web -page `_. The web page contains versions of the +page `_. The web page contains versions of the API documentation which are up-to-date with the Subversion version of the source code. You can access versions of these documents specific to this release by going into the "``clang/docs/``" directory in the Clang tree. If you have any questions or comments about Clang, please feel free to contact us via the `mailing -list `_. +list `_. Index: vendor/clang/dist-release_70/lib/Driver/ToolChains/Clang.cpp =================================================================== --- vendor/clang/dist-release_70/lib/Driver/ToolChains/Clang.cpp (revision 338576) +++ vendor/clang/dist-release_70/lib/Driver/ToolChains/Clang.cpp (revision 338577) @@ -1,5692 +1,5691 @@ //===--- LLVM.cpp - Clang+LLVM ToolChain Implementations --------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #include "Clang.h" #include "Arch/AArch64.h" #include "Arch/ARM.h" #include "Arch/Mips.h" #include "Arch/PPC.h" #include "Arch/RISCV.h" #include "Arch/Sparc.h" #include "Arch/SystemZ.h" #include "Arch/X86.h" #include "AMDGPU.h" #include "CommonArgs.h" #include "Hexagon.h" #include "InputInfo.h" #include "PS4CPU.h" #include "clang/Basic/CharInfo.h" #include "clang/Basic/LangOptions.h" #include "clang/Basic/ObjCRuntime.h" #include "clang/Basic/Version.h" #include "clang/Driver/DriverDiagnostic.h" #include "clang/Driver/Options.h" #include "clang/Driver/SanitizerArgs.h" #include "clang/Driver/XRayArgs.h" #include "llvm/ADT/StringExtras.h" #include "llvm/Config/llvm-config.h" #include "llvm/Option/ArgList.h" #include "llvm/Support/CodeGen.h" #include "llvm/Support/Compression.h" #include "llvm/Support/FileSystem.h" #include "llvm/Support/Path.h" #include "llvm/Support/Process.h" #include "llvm/Support/TargetParser.h" #include "llvm/Support/YAMLParser.h" #ifdef LLVM_ON_UNIX #include // For getuid(). #endif using namespace clang::driver; using namespace clang::driver::tools; using namespace clang; using namespace llvm::opt; static void CheckPreprocessingOptions(const Driver &D, const ArgList &Args) { if (Arg *A = Args.getLastArg(clang::driver::options::OPT_C, options::OPT_CC)) { if (!Args.hasArg(options::OPT_E) && !Args.hasArg(options::OPT__SLASH_P) && !Args.hasArg(options::OPT__SLASH_EP) && !D.CCCIsCPP()) { D.Diag(clang::diag::err_drv_argument_only_allowed_with) << A->getBaseArg().getAsString(Args) << (D.IsCLMode() ? "/E, /P or /EP" : "-E"); } } } static void CheckCodeGenerationOptions(const Driver &D, const ArgList &Args) { // In gcc, only ARM checks this, but it seems reasonable to check universally. if (Args.hasArg(options::OPT_static)) if (const Arg *A = Args.getLastArg(options::OPT_dynamic, options::OPT_mdynamic_no_pic)) D.Diag(diag::err_drv_argument_not_allowed_with) << A->getAsString(Args) << "-static"; } // Add backslashes to escape spaces and other backslashes. // This is used for the space-separated argument list specified with // the -dwarf-debug-flags option. static void EscapeSpacesAndBackslashes(const char *Arg, SmallVectorImpl &Res) { for (; *Arg; ++Arg) { switch (*Arg) { default: break; case ' ': case '\\': Res.push_back('\\'); break; } Res.push_back(*Arg); } } // Quote target names for inclusion in GNU Make dependency files. // Only the characters '$', '#', ' ', '\t' are quoted. static void QuoteTarget(StringRef Target, SmallVectorImpl &Res) { for (unsigned i = 0, e = Target.size(); i != e; ++i) { switch (Target[i]) { case ' ': case '\t': // Escape the preceding backslashes for (int j = i - 1; j >= 0 && Target[j] == '\\'; --j) Res.push_back('\\'); // Escape the space/tab Res.push_back('\\'); break; case '$': Res.push_back('$'); break; case '#': Res.push_back('\\'); break; default: break; } Res.push_back(Target[i]); } } /// Apply \a Work on the current tool chain \a RegularToolChain and any other /// offloading tool chain that is associated with the current action \a JA. static void forAllAssociatedToolChains(Compilation &C, const JobAction &JA, const ToolChain &RegularToolChain, llvm::function_ref Work) { // Apply Work on the current/regular tool chain. Work(RegularToolChain); // Apply Work on all the offloading tool chains associated with the current // action. if (JA.isHostOffloading(Action::OFK_Cuda)) Work(*C.getSingleOffloadToolChain()); else if (JA.isDeviceOffloading(Action::OFK_Cuda)) Work(*C.getSingleOffloadToolChain()); else if (JA.isHostOffloading(Action::OFK_HIP)) Work(*C.getSingleOffloadToolChain()); else if (JA.isDeviceOffloading(Action::OFK_HIP)) Work(*C.getSingleOffloadToolChain()); if (JA.isHostOffloading(Action::OFK_OpenMP)) { auto TCs = C.getOffloadToolChains(); for (auto II = TCs.first, IE = TCs.second; II != IE; ++II) Work(*II->second); } else if (JA.isDeviceOffloading(Action::OFK_OpenMP)) Work(*C.getSingleOffloadToolChain()); // // TODO: Add support for other offloading programming models here. // } /// This is a helper function for validating the optional refinement step /// parameter in reciprocal argument strings. Return false if there is an error /// parsing the refinement step. Otherwise, return true and set the Position /// of the refinement step in the input string. static bool getRefinementStep(StringRef In, const Driver &D, const Arg &A, size_t &Position) { const char RefinementStepToken = ':'; Position = In.find(RefinementStepToken); if (Position != StringRef::npos) { StringRef Option = A.getOption().getName(); StringRef RefStep = In.substr(Position + 1); // Allow exactly one numeric character for the additional refinement // step parameter. This is reasonable for all currently-supported // operations and architectures because we would expect that a larger value // of refinement steps would cause the estimate "optimization" to // under-perform the native operation. Also, if the estimate does not // converge quickly, it probably will not ever converge, so further // refinement steps will not produce a better answer. if (RefStep.size() != 1) { D.Diag(diag::err_drv_invalid_value) << Option << RefStep; return false; } char RefStepChar = RefStep[0]; if (RefStepChar < '0' || RefStepChar > '9') { D.Diag(diag::err_drv_invalid_value) << Option << RefStep; return false; } } return true; } /// The -mrecip flag requires processing of many optional parameters. static void ParseMRecip(const Driver &D, const ArgList &Args, ArgStringList &OutStrings) { StringRef DisabledPrefixIn = "!"; StringRef DisabledPrefixOut = "!"; StringRef EnabledPrefixOut = ""; StringRef Out = "-mrecip="; Arg *A = Args.getLastArg(options::OPT_mrecip, options::OPT_mrecip_EQ); if (!A) return; unsigned NumOptions = A->getNumValues(); if (NumOptions == 0) { // No option is the same as "all". OutStrings.push_back(Args.MakeArgString(Out + "all")); return; } // Pass through "all", "none", or "default" with an optional refinement step. if (NumOptions == 1) { StringRef Val = A->getValue(0); size_t RefStepLoc; if (!getRefinementStep(Val, D, *A, RefStepLoc)) return; StringRef ValBase = Val.slice(0, RefStepLoc); if (ValBase == "all" || ValBase == "none" || ValBase == "default") { OutStrings.push_back(Args.MakeArgString(Out + Val)); return; } } // Each reciprocal type may be enabled or disabled individually. // Check each input value for validity, concatenate them all back together, // and pass through. llvm::StringMap OptionStrings; OptionStrings.insert(std::make_pair("divd", false)); OptionStrings.insert(std::make_pair("divf", false)); OptionStrings.insert(std::make_pair("vec-divd", false)); OptionStrings.insert(std::make_pair("vec-divf", false)); OptionStrings.insert(std::make_pair("sqrtd", false)); OptionStrings.insert(std::make_pair("sqrtf", false)); OptionStrings.insert(std::make_pair("vec-sqrtd", false)); OptionStrings.insert(std::make_pair("vec-sqrtf", false)); for (unsigned i = 0; i != NumOptions; ++i) { StringRef Val = A->getValue(i); bool IsDisabled = Val.startswith(DisabledPrefixIn); // Ignore the disablement token for string matching. if (IsDisabled) Val = Val.substr(1); size_t RefStep; if (!getRefinementStep(Val, D, *A, RefStep)) return; StringRef ValBase = Val.slice(0, RefStep); llvm::StringMap::iterator OptionIter = OptionStrings.find(ValBase); if (OptionIter == OptionStrings.end()) { // Try again specifying float suffix. OptionIter = OptionStrings.find(ValBase.str() + 'f'); if (OptionIter == OptionStrings.end()) { // The input name did not match any known option string. D.Diag(diag::err_drv_unknown_argument) << Val; return; } // The option was specified without a float or double suffix. // Make sure that the double entry was not already specified. // The float entry will be checked below. if (OptionStrings[ValBase.str() + 'd']) { D.Diag(diag::err_drv_invalid_value) << A->getOption().getName() << Val; return; } } if (OptionIter->second == true) { // Duplicate option specified. D.Diag(diag::err_drv_invalid_value) << A->getOption().getName() << Val; return; } // Mark the matched option as found. Do not allow duplicate specifiers. OptionIter->second = true; // If the precision was not specified, also mark the double entry as found. if (ValBase.back() != 'f' && ValBase.back() != 'd') OptionStrings[ValBase.str() + 'd'] = true; // Build the output string. StringRef Prefix = IsDisabled ? DisabledPrefixOut : EnabledPrefixOut; Out = Args.MakeArgString(Out + Prefix + Val); if (i != NumOptions - 1) Out = Args.MakeArgString(Out + ","); } OutStrings.push_back(Args.MakeArgString(Out)); } /// The -mprefer-vector-width option accepts either a positive integer /// or the string "none". static void ParseMPreferVectorWidth(const Driver &D, const ArgList &Args, ArgStringList &CmdArgs) { Arg *A = Args.getLastArg(options::OPT_mprefer_vector_width_EQ); if (!A) return; StringRef Value = A->getValue(); if (Value == "none") { CmdArgs.push_back("-mprefer-vector-width=none"); } else { unsigned Width; if (Value.getAsInteger(10, Width)) { D.Diag(diag::err_drv_invalid_value) << A->getOption().getName() << Value; return; } CmdArgs.push_back(Args.MakeArgString("-mprefer-vector-width=" + Value)); } } static void getWebAssemblyTargetFeatures(const ArgList &Args, std::vector &Features) { handleTargetFeaturesGroup(Args, Features, options::OPT_m_wasm_Features_Group); } static void getTargetFeatures(const ToolChain &TC, const llvm::Triple &Triple, const ArgList &Args, ArgStringList &CmdArgs, bool ForAS) { const Driver &D = TC.getDriver(); std::vector Features; switch (Triple.getArch()) { default: break; case llvm::Triple::mips: case llvm::Triple::mipsel: case llvm::Triple::mips64: case llvm::Triple::mips64el: mips::getMIPSTargetFeatures(D, Triple, Args, Features); break; case llvm::Triple::arm: case llvm::Triple::armeb: case llvm::Triple::thumb: case llvm::Triple::thumbeb: arm::getARMTargetFeatures(TC, Triple, Args, CmdArgs, Features, ForAS); break; case llvm::Triple::ppc: case llvm::Triple::ppc64: case llvm::Triple::ppc64le: ppc::getPPCTargetFeatures(D, Triple, Args, Features); break; case llvm::Triple::riscv32: case llvm::Triple::riscv64: riscv::getRISCVTargetFeatures(D, Args, Features); break; case llvm::Triple::systemz: systemz::getSystemZTargetFeatures(Args, Features); break; case llvm::Triple::aarch64: case llvm::Triple::aarch64_be: aarch64::getAArch64TargetFeatures(D, Args, Features); break; case llvm::Triple::x86: case llvm::Triple::x86_64: x86::getX86TargetFeatures(D, Triple, Args, Features); break; case llvm::Triple::hexagon: hexagon::getHexagonTargetFeatures(D, Args, Features); break; case llvm::Triple::wasm32: case llvm::Triple::wasm64: getWebAssemblyTargetFeatures(Args, Features); break; case llvm::Triple::sparc: case llvm::Triple::sparcel: case llvm::Triple::sparcv9: sparc::getSparcTargetFeatures(D, Args, Features); break; case llvm::Triple::r600: case llvm::Triple::amdgcn: amdgpu::getAMDGPUTargetFeatures(D, Args, Features); break; } // Find the last of each feature. llvm::StringMap LastOpt; for (unsigned I = 0, N = Features.size(); I < N; ++I) { StringRef Name = Features[I]; assert(Name[0] == '-' || Name[0] == '+'); LastOpt[Name.drop_front(1)] = I; } for (unsigned I = 0, N = Features.size(); I < N; ++I) { // If this feature was overridden, ignore it. StringRef Name = Features[I]; llvm::StringMap::iterator LastI = LastOpt.find(Name.drop_front(1)); assert(LastI != LastOpt.end()); unsigned Last = LastI->second; if (Last != I) continue; CmdArgs.push_back("-target-feature"); CmdArgs.push_back(Name.data()); } } static bool shouldUseExceptionTablesForObjCExceptions(const ObjCRuntime &runtime, const llvm::Triple &Triple) { // We use the zero-cost exception tables for Objective-C if the non-fragile // ABI is enabled or when compiling for x86_64 and ARM on Snow Leopard and // later. if (runtime.isNonFragile()) return true; if (!Triple.isMacOSX()) return false; return (!Triple.isMacOSXVersionLT(10, 5) && (Triple.getArch() == llvm::Triple::x86_64 || Triple.getArch() == llvm::Triple::arm)); } /// Adds exception related arguments to the driver command arguments. There's a /// master flag, -fexceptions and also language specific flags to enable/disable /// C++ and Objective-C exceptions. This makes it possible to for example /// disable C++ exceptions but enable Objective-C exceptions. static void addExceptionArgs(const ArgList &Args, types::ID InputType, const ToolChain &TC, bool KernelOrKext, const ObjCRuntime &objcRuntime, ArgStringList &CmdArgs) { const llvm::Triple &Triple = TC.getTriple(); if (KernelOrKext) { // -mkernel and -fapple-kext imply no exceptions, so claim exception related // arguments now to avoid warnings about unused arguments. Args.ClaimAllArgs(options::OPT_fexceptions); Args.ClaimAllArgs(options::OPT_fno_exceptions); Args.ClaimAllArgs(options::OPT_fobjc_exceptions); Args.ClaimAllArgs(options::OPT_fno_objc_exceptions); Args.ClaimAllArgs(options::OPT_fcxx_exceptions); Args.ClaimAllArgs(options::OPT_fno_cxx_exceptions); return; } // See if the user explicitly enabled exceptions. bool EH = Args.hasFlag(options::OPT_fexceptions, options::OPT_fno_exceptions, false); // Obj-C exceptions are enabled by default, regardless of -fexceptions. This // is not necessarily sensible, but follows GCC. if (types::isObjC(InputType) && Args.hasFlag(options::OPT_fobjc_exceptions, options::OPT_fno_objc_exceptions, true)) { CmdArgs.push_back("-fobjc-exceptions"); EH |= shouldUseExceptionTablesForObjCExceptions(objcRuntime, Triple); } if (types::isCXX(InputType)) { // Disable C++ EH by default on XCore and PS4. bool CXXExceptionsEnabled = Triple.getArch() != llvm::Triple::xcore && !Triple.isPS4CPU(); Arg *ExceptionArg = Args.getLastArg( options::OPT_fcxx_exceptions, options::OPT_fno_cxx_exceptions, options::OPT_fexceptions, options::OPT_fno_exceptions); if (ExceptionArg) CXXExceptionsEnabled = ExceptionArg->getOption().matches(options::OPT_fcxx_exceptions) || ExceptionArg->getOption().matches(options::OPT_fexceptions); if (CXXExceptionsEnabled) { CmdArgs.push_back("-fcxx-exceptions"); EH = true; } } if (EH) CmdArgs.push_back("-fexceptions"); } static bool ShouldDisableAutolink(const ArgList &Args, const ToolChain &TC) { bool Default = true; if (TC.getTriple().isOSDarwin()) { // The native darwin assembler doesn't support the linker_option directives, // so we disable them if we think the .s file will be passed to it. Default = TC.useIntegratedAs(); } return !Args.hasFlag(options::OPT_fautolink, options::OPT_fno_autolink, Default); } static bool ShouldDisableDwarfDirectory(const ArgList &Args, const ToolChain &TC) { bool UseDwarfDirectory = Args.hasFlag(options::OPT_fdwarf_directory_asm, options::OPT_fno_dwarf_directory_asm, TC.useIntegratedAs()); return !UseDwarfDirectory; } // Convert an arg of the form "-gN" or "-ggdbN" or one of their aliases // to the corresponding DebugInfoKind. static codegenoptions::DebugInfoKind DebugLevelToInfoKind(const Arg &A) { assert(A.getOption().matches(options::OPT_gN_Group) && "Not a -g option that specifies a debug-info level"); if (A.getOption().matches(options::OPT_g0) || A.getOption().matches(options::OPT_ggdb0)) return codegenoptions::NoDebugInfo; if (A.getOption().matches(options::OPT_gline_tables_only) || A.getOption().matches(options::OPT_ggdb1)) return codegenoptions::DebugLineTablesOnly; return codegenoptions::LimitedDebugInfo; } static bool mustUseNonLeafFramePointerForTarget(const llvm::Triple &Triple) { switch (Triple.getArch()){ default: return false; case llvm::Triple::arm: case llvm::Triple::thumb: // ARM Darwin targets require a frame pointer to be always present to aid // offline debugging via backtraces. return Triple.isOSDarwin(); } } static bool useFramePointerForTargetByDefault(const ArgList &Args, const llvm::Triple &Triple) { switch (Triple.getArch()) { case llvm::Triple::xcore: case llvm::Triple::wasm32: case llvm::Triple::wasm64: // XCore never wants frame pointers, regardless of OS. // WebAssembly never wants frame pointers. return false; case llvm::Triple::riscv32: case llvm::Triple::riscv64: return !areOptimizationsEnabled(Args); default: break; } if (Triple.getOS() == llvm::Triple::NetBSD) { return !areOptimizationsEnabled(Args); } if (Triple.isOSLinux() || Triple.getOS() == llvm::Triple::CloudABI) { switch (Triple.getArch()) { // Don't use a frame pointer on linux if optimizing for certain targets. case llvm::Triple::mips64: case llvm::Triple::mips64el: case llvm::Triple::mips: case llvm::Triple::mipsel: case llvm::Triple::ppc: case llvm::Triple::ppc64: case llvm::Triple::ppc64le: case llvm::Triple::systemz: case llvm::Triple::x86: case llvm::Triple::x86_64: return !areOptimizationsEnabled(Args); default: return true; } } if (Triple.isOSWindows()) { switch (Triple.getArch()) { case llvm::Triple::x86: return !areOptimizationsEnabled(Args); case llvm::Triple::x86_64: return Triple.isOSBinFormatMachO(); case llvm::Triple::arm: case llvm::Triple::thumb: // Windows on ARM builds with FPO disabled to aid fast stack walking return true; default: // All other supported Windows ISAs use xdata unwind information, so frame // pointers are not generally useful. return false; } } return true; } static bool shouldUseFramePointer(const ArgList &Args, const llvm::Triple &Triple) { if (Arg *A = Args.getLastArg(options::OPT_fno_omit_frame_pointer, options::OPT_fomit_frame_pointer)) return A->getOption().matches(options::OPT_fno_omit_frame_pointer) || mustUseNonLeafFramePointerForTarget(Triple); if (Args.hasArg(options::OPT_pg)) return true; return useFramePointerForTargetByDefault(Args, Triple); } static bool shouldUseLeafFramePointer(const ArgList &Args, const llvm::Triple &Triple) { if (Arg *A = Args.getLastArg(options::OPT_mno_omit_leaf_frame_pointer, options::OPT_momit_leaf_frame_pointer)) return A->getOption().matches(options::OPT_mno_omit_leaf_frame_pointer); if (Args.hasArg(options::OPT_pg)) return true; if (Triple.isPS4CPU()) return false; return useFramePointerForTargetByDefault(Args, Triple); } /// Add a CC1 option to specify the debug compilation directory. static void addDebugCompDirArg(const ArgList &Args, ArgStringList &CmdArgs) { SmallString<128> cwd; if (!llvm::sys::fs::current_path(cwd)) { CmdArgs.push_back("-fdebug-compilation-dir"); CmdArgs.push_back(Args.MakeArgString(cwd)); } } /// Add a CC1 and CC1AS option to specify the debug file path prefix map. static void addDebugPrefixMapArg(const Driver &D, const ArgList &Args, ArgStringList &CmdArgs) { for (const Arg *A : Args.filtered(options::OPT_fdebug_prefix_map_EQ)) { StringRef Map = A->getValue(); if (Map.find('=') == StringRef::npos) D.Diag(diag::err_drv_invalid_argument_to_fdebug_prefix_map) << Map; else CmdArgs.push_back(Args.MakeArgString("-fdebug-prefix-map=" + Map)); A->claim(); } } /// Vectorize at all optimization levels greater than 1 except for -Oz. /// For -Oz the loop vectorizer is disable, while the slp vectorizer is enabled. static bool shouldEnableVectorizerAtOLevel(const ArgList &Args, bool isSlpVec) { if (Arg *A = Args.getLastArg(options::OPT_O_Group)) { if (A->getOption().matches(options::OPT_O4) || A->getOption().matches(options::OPT_Ofast)) return true; if (A->getOption().matches(options::OPT_O0)) return false; assert(A->getOption().matches(options::OPT_O) && "Must have a -O flag"); // Vectorize -Os. StringRef S(A->getValue()); if (S == "s") return true; // Don't vectorize -Oz, unless it's the slp vectorizer. if (S == "z") return isSlpVec; unsigned OptLevel = 0; if (S.getAsInteger(10, OptLevel)) return false; return OptLevel > 1; } return false; } /// Add -x lang to \p CmdArgs for \p Input. static void addDashXForInput(const ArgList &Args, const InputInfo &Input, ArgStringList &CmdArgs) { // When using -verify-pch, we don't want to provide the type // 'precompiled-header' if it was inferred from the file extension if (Args.hasArg(options::OPT_verify_pch) && Input.getType() == types::TY_PCH) return; CmdArgs.push_back("-x"); if (Args.hasArg(options::OPT_rewrite_objc)) CmdArgs.push_back(types::getTypeName(types::TY_PP_ObjCXX)); else { // Map the driver type to the frontend type. This is mostly an identity // mapping, except that the distinction between module interface units // and other source files does not exist at the frontend layer. const char *ClangType; switch (Input.getType()) { case types::TY_CXXModule: ClangType = "c++"; break; case types::TY_PP_CXXModule: ClangType = "c++-cpp-output"; break; default: ClangType = types::getTypeName(Input.getType()); break; } CmdArgs.push_back(ClangType); } } static void appendUserToPath(SmallVectorImpl &Result) { #ifdef LLVM_ON_UNIX const char *Username = getenv("LOGNAME"); #else const char *Username = getenv("USERNAME"); #endif if (Username) { // Validate that LoginName can be used in a path, and get its length. size_t Len = 0; for (const char *P = Username; *P; ++P, ++Len) { if (!clang::isAlphanumeric(*P) && *P != '_') { Username = nullptr; break; } } if (Username && Len > 0) { Result.append(Username, Username + Len); return; } } // Fallback to user id. #ifdef LLVM_ON_UNIX std::string UID = llvm::utostr(getuid()); #else // FIXME: Windows seems to have an 'SID' that might work. std::string UID = "9999"; #endif Result.append(UID.begin(), UID.end()); } static void addPGOAndCoverageFlags(Compilation &C, const Driver &D, const InputInfo &Output, const ArgList &Args, ArgStringList &CmdArgs) { auto *PGOGenerateArg = Args.getLastArg(options::OPT_fprofile_generate, options::OPT_fprofile_generate_EQ, options::OPT_fno_profile_generate); if (PGOGenerateArg && PGOGenerateArg->getOption().matches(options::OPT_fno_profile_generate)) PGOGenerateArg = nullptr; auto *ProfileGenerateArg = Args.getLastArg( options::OPT_fprofile_instr_generate, options::OPT_fprofile_instr_generate_EQ, options::OPT_fno_profile_instr_generate); if (ProfileGenerateArg && ProfileGenerateArg->getOption().matches( options::OPT_fno_profile_instr_generate)) ProfileGenerateArg = nullptr; if (PGOGenerateArg && ProfileGenerateArg) D.Diag(diag::err_drv_argument_not_allowed_with) << PGOGenerateArg->getSpelling() << ProfileGenerateArg->getSpelling(); auto *ProfileUseArg = getLastProfileUseArg(Args); if (PGOGenerateArg && ProfileUseArg) D.Diag(diag::err_drv_argument_not_allowed_with) << ProfileUseArg->getSpelling() << PGOGenerateArg->getSpelling(); if (ProfileGenerateArg && ProfileUseArg) D.Diag(diag::err_drv_argument_not_allowed_with) << ProfileGenerateArg->getSpelling() << ProfileUseArg->getSpelling(); if (ProfileGenerateArg) { if (ProfileGenerateArg->getOption().matches( options::OPT_fprofile_instr_generate_EQ)) CmdArgs.push_back(Args.MakeArgString(Twine("-fprofile-instrument-path=") + ProfileGenerateArg->getValue())); // The default is to use Clang Instrumentation. CmdArgs.push_back("-fprofile-instrument=clang"); } if (PGOGenerateArg) { CmdArgs.push_back("-fprofile-instrument=llvm"); if (PGOGenerateArg->getOption().matches( options::OPT_fprofile_generate_EQ)) { SmallString<128> Path(PGOGenerateArg->getValue()); llvm::sys::path::append(Path, "default_%m.profraw"); CmdArgs.push_back( Args.MakeArgString(Twine("-fprofile-instrument-path=") + Path)); } } if (ProfileUseArg) { if (ProfileUseArg->getOption().matches(options::OPT_fprofile_instr_use_EQ)) CmdArgs.push_back(Args.MakeArgString( Twine("-fprofile-instrument-use-path=") + ProfileUseArg->getValue())); else if ((ProfileUseArg->getOption().matches( options::OPT_fprofile_use_EQ) || ProfileUseArg->getOption().matches( options::OPT_fprofile_instr_use))) { SmallString<128> Path( ProfileUseArg->getNumValues() == 0 ? "" : ProfileUseArg->getValue()); if (Path.empty() || llvm::sys::fs::is_directory(Path)) llvm::sys::path::append(Path, "default.profdata"); CmdArgs.push_back( Args.MakeArgString(Twine("-fprofile-instrument-use-path=") + Path)); } } if (Args.hasArg(options::OPT_ftest_coverage) || Args.hasArg(options::OPT_coverage)) CmdArgs.push_back("-femit-coverage-notes"); if (Args.hasFlag(options::OPT_fprofile_arcs, options::OPT_fno_profile_arcs, false) || Args.hasArg(options::OPT_coverage)) CmdArgs.push_back("-femit-coverage-data"); if (Args.hasFlag(options::OPT_fcoverage_mapping, options::OPT_fno_coverage_mapping, false)) { if (!ProfileGenerateArg) D.Diag(clang::diag::err_drv_argument_only_allowed_with) << "-fcoverage-mapping" << "-fprofile-instr-generate"; CmdArgs.push_back("-fcoverage-mapping"); } if (C.getArgs().hasArg(options::OPT_c) || C.getArgs().hasArg(options::OPT_S)) { if (Output.isFilename()) { CmdArgs.push_back("-coverage-notes-file"); SmallString<128> OutputFilename; if (Arg *FinalOutput = C.getArgs().getLastArg(options::OPT_o)) OutputFilename = FinalOutput->getValue(); else OutputFilename = llvm::sys::path::filename(Output.getBaseInput()); SmallString<128> CoverageFilename = OutputFilename; if (llvm::sys::path::is_relative(CoverageFilename)) { SmallString<128> Pwd; if (!llvm::sys::fs::current_path(Pwd)) { llvm::sys::path::append(Pwd, CoverageFilename); CoverageFilename.swap(Pwd); } } llvm::sys::path::replace_extension(CoverageFilename, "gcno"); CmdArgs.push_back(Args.MakeArgString(CoverageFilename)); // Leave -fprofile-dir= an unused argument unless .gcda emission is // enabled. To be polite, with '-fprofile-arcs -fno-profile-arcs' consider // the flag used. There is no -fno-profile-dir, so the user has no // targeted way to suppress the warning. if (Args.hasArg(options::OPT_fprofile_arcs) || Args.hasArg(options::OPT_coverage)) { CmdArgs.push_back("-coverage-data-file"); if (Arg *FProfileDir = Args.getLastArg(options::OPT_fprofile_dir)) { CoverageFilename = FProfileDir->getValue(); llvm::sys::path::append(CoverageFilename, OutputFilename); } llvm::sys::path::replace_extension(CoverageFilename, "gcda"); CmdArgs.push_back(Args.MakeArgString(CoverageFilename)); } } } } /// Check whether the given input tree contains any compilation actions. static bool ContainsCompileAction(const Action *A) { if (isa(A) || isa(A)) return true; for (const auto &AI : A->inputs()) if (ContainsCompileAction(AI)) return true; return false; } /// Check if -relax-all should be passed to the internal assembler. /// This is done by default when compiling non-assembler source with -O0. static bool UseRelaxAll(Compilation &C, const ArgList &Args) { bool RelaxDefault = true; if (Arg *A = Args.getLastArg(options::OPT_O_Group)) RelaxDefault = A->getOption().matches(options::OPT_O0); if (RelaxDefault) { RelaxDefault = false; for (const auto &Act : C.getActions()) { if (ContainsCompileAction(Act)) { RelaxDefault = true; break; } } } return Args.hasFlag(options::OPT_mrelax_all, options::OPT_mno_relax_all, RelaxDefault); } // Extract the integer N from a string spelled "-dwarf-N", returning 0 // on mismatch. The StringRef input (rather than an Arg) allows // for use by the "-Xassembler" option parser. static unsigned DwarfVersionNum(StringRef ArgValue) { return llvm::StringSwitch(ArgValue) .Case("-gdwarf-2", 2) .Case("-gdwarf-3", 3) .Case("-gdwarf-4", 4) .Case("-gdwarf-5", 5) .Default(0); } static void RenderDebugEnablingArgs(const ArgList &Args, ArgStringList &CmdArgs, codegenoptions::DebugInfoKind DebugInfoKind, unsigned DwarfVersion, llvm::DebuggerKind DebuggerTuning) { switch (DebugInfoKind) { case codegenoptions::DebugLineTablesOnly: CmdArgs.push_back("-debug-info-kind=line-tables-only"); break; case codegenoptions::LimitedDebugInfo: CmdArgs.push_back("-debug-info-kind=limited"); break; case codegenoptions::FullDebugInfo: CmdArgs.push_back("-debug-info-kind=standalone"); break; default: break; } if (DwarfVersion > 0) CmdArgs.push_back( Args.MakeArgString("-dwarf-version=" + Twine(DwarfVersion))); switch (DebuggerTuning) { case llvm::DebuggerKind::GDB: CmdArgs.push_back("-debugger-tuning=gdb"); break; case llvm::DebuggerKind::LLDB: CmdArgs.push_back("-debugger-tuning=lldb"); break; case llvm::DebuggerKind::SCE: CmdArgs.push_back("-debugger-tuning=sce"); break; default: break; } } static bool checkDebugInfoOption(const Arg *A, const ArgList &Args, const Driver &D, const ToolChain &TC) { assert(A && "Expected non-nullptr argument."); if (TC.supportsDebugInfoOption(A)) return true; D.Diag(diag::warn_drv_unsupported_debug_info_opt_for_target) << A->getAsString(Args) << TC.getTripleString(); return false; } static void RenderDebugInfoCompressionArgs(const ArgList &Args, ArgStringList &CmdArgs, const Driver &D, const ToolChain &TC) { const Arg *A = Args.getLastArg(options::OPT_gz, options::OPT_gz_EQ); if (!A) return; if (checkDebugInfoOption(A, Args, D, TC)) { if (A->getOption().getID() == options::OPT_gz) { if (llvm::zlib::isAvailable()) CmdArgs.push_back("-compress-debug-sections"); else D.Diag(diag::warn_debug_compression_unavailable); return; } StringRef Value = A->getValue(); if (Value == "none") { CmdArgs.push_back("-compress-debug-sections=none"); } else if (Value == "zlib" || Value == "zlib-gnu") { if (llvm::zlib::isAvailable()) { CmdArgs.push_back( Args.MakeArgString("-compress-debug-sections=" + Twine(Value))); } else { D.Diag(diag::warn_debug_compression_unavailable); } } else { D.Diag(diag::err_drv_unsupported_option_argument) << A->getOption().getName() << Value; } } } static const char *RelocationModelName(llvm::Reloc::Model Model) { switch (Model) { case llvm::Reloc::Static: return "static"; case llvm::Reloc::PIC_: return "pic"; case llvm::Reloc::DynamicNoPIC: return "dynamic-no-pic"; case llvm::Reloc::ROPI: return "ropi"; case llvm::Reloc::RWPI: return "rwpi"; case llvm::Reloc::ROPI_RWPI: return "ropi-rwpi"; } llvm_unreachable("Unknown Reloc::Model kind"); } void Clang::AddPreprocessingOptions(Compilation &C, const JobAction &JA, const Driver &D, const ArgList &Args, ArgStringList &CmdArgs, const InputInfo &Output, const InputInfoList &Inputs) const { Arg *A; const bool IsIAMCU = getToolChain().getTriple().isOSIAMCU(); CheckPreprocessingOptions(D, Args); Args.AddLastArg(CmdArgs, options::OPT_C); Args.AddLastArg(CmdArgs, options::OPT_CC); // Handle dependency file generation. if ((A = Args.getLastArg(options::OPT_M, options::OPT_MM)) || (A = Args.getLastArg(options::OPT_MD)) || (A = Args.getLastArg(options::OPT_MMD))) { // Determine the output location. const char *DepFile; if (Arg *MF = Args.getLastArg(options::OPT_MF)) { DepFile = MF->getValue(); C.addFailureResultFile(DepFile, &JA); } else if (Output.getType() == types::TY_Dependencies) { DepFile = Output.getFilename(); } else if (A->getOption().matches(options::OPT_M) || A->getOption().matches(options::OPT_MM)) { DepFile = "-"; } else { DepFile = getDependencyFileName(Args, Inputs); C.addFailureResultFile(DepFile, &JA); } CmdArgs.push_back("-dependency-file"); CmdArgs.push_back(DepFile); // Add a default target if one wasn't specified. if (!Args.hasArg(options::OPT_MT) && !Args.hasArg(options::OPT_MQ)) { const char *DepTarget; // If user provided -o, that is the dependency target, except // when we are only generating a dependency file. Arg *OutputOpt = Args.getLastArg(options::OPT_o); if (OutputOpt && Output.getType() != types::TY_Dependencies) { DepTarget = OutputOpt->getValue(); } else { // Otherwise derive from the base input. // // FIXME: This should use the computed output file location. SmallString<128> P(Inputs[0].getBaseInput()); llvm::sys::path::replace_extension(P, "o"); DepTarget = Args.MakeArgString(llvm::sys::path::filename(P)); } if (!A->getOption().matches(options::OPT_MD) && !A->getOption().matches(options::OPT_MMD)) { CmdArgs.push_back("-w"); } CmdArgs.push_back("-MT"); SmallString<128> Quoted; QuoteTarget(DepTarget, Quoted); CmdArgs.push_back(Args.MakeArgString(Quoted)); } if (A->getOption().matches(options::OPT_M) || A->getOption().matches(options::OPT_MD)) CmdArgs.push_back("-sys-header-deps"); if ((isa(JA) && !Args.hasArg(options::OPT_fno_module_file_deps)) || Args.hasArg(options::OPT_fmodule_file_deps)) CmdArgs.push_back("-module-file-deps"); } if (Args.hasArg(options::OPT_MG)) { if (!A || A->getOption().matches(options::OPT_MD) || A->getOption().matches(options::OPT_MMD)) D.Diag(diag::err_drv_mg_requires_m_or_mm); CmdArgs.push_back("-MG"); } Args.AddLastArg(CmdArgs, options::OPT_MP); Args.AddLastArg(CmdArgs, options::OPT_MV); // Convert all -MQ args to -MT for (const Arg *A : Args.filtered(options::OPT_MT, options::OPT_MQ)) { A->claim(); if (A->getOption().matches(options::OPT_MQ)) { CmdArgs.push_back("-MT"); SmallString<128> Quoted; QuoteTarget(A->getValue(), Quoted); CmdArgs.push_back(Args.MakeArgString(Quoted)); // -MT flag - no change } else { A->render(Args, CmdArgs); } } // Add offload include arguments specific for CUDA. This must happen before // we -I or -include anything else, because we must pick up the CUDA headers // from the particular CUDA installation, rather than from e.g. // /usr/local/include. if (JA.isOffloading(Action::OFK_Cuda)) getToolChain().AddCudaIncludeArgs(Args, CmdArgs); // Add -i* options, and automatically translate to // -include-pch/-include-pth for transparent PCH support. It's // wonky, but we include looking for .gch so we can support seamless // replacement into a build system already set up to be generating // .gch files. if (getToolChain().getDriver().IsCLMode()) { const Arg *YcArg = Args.getLastArg(options::OPT__SLASH_Yc); const Arg *YuArg = Args.getLastArg(options::OPT__SLASH_Yu); if (YcArg && JA.getKind() >= Action::PrecompileJobClass && JA.getKind() <= Action::AssembleJobClass) { CmdArgs.push_back(Args.MakeArgString("-building-pch-with-obj")); } if (YcArg || YuArg) { StringRef ThroughHeader = YcArg ? YcArg->getValue() : YuArg->getValue(); if (!isa(JA)) { CmdArgs.push_back("-include-pch"); CmdArgs.push_back(Args.MakeArgString(D.GetClPchPath(C, ThroughHeader))); } CmdArgs.push_back( Args.MakeArgString(Twine("-pch-through-header=") + ThroughHeader)); } } bool RenderedImplicitInclude = false; for (const Arg *A : Args.filtered(options::OPT_clang_i_Group)) { if (A->getOption().matches(options::OPT_include)) { // Handling of gcc-style gch precompiled headers. bool IsFirstImplicitInclude = !RenderedImplicitInclude; RenderedImplicitInclude = true; // Use PCH if the user requested it. bool UsePCH = D.CCCUsePCH; bool FoundPTH = false; bool FoundPCH = false; SmallString<128> P(A->getValue()); // We want the files to have a name like foo.h.pch. Add a dummy extension // so that replace_extension does the right thing. P += ".dummy"; if (UsePCH) { llvm::sys::path::replace_extension(P, "pch"); if (llvm::sys::fs::exists(P)) FoundPCH = true; } if (!FoundPCH) { llvm::sys::path::replace_extension(P, "pth"); if (llvm::sys::fs::exists(P)) FoundPTH = true; } if (!FoundPCH && !FoundPTH) { llvm::sys::path::replace_extension(P, "gch"); if (llvm::sys::fs::exists(P)) { FoundPCH = UsePCH; FoundPTH = !UsePCH; } } if (FoundPCH || FoundPTH) { if (IsFirstImplicitInclude) { A->claim(); if (UsePCH) CmdArgs.push_back("-include-pch"); else CmdArgs.push_back("-include-pth"); CmdArgs.push_back(Args.MakeArgString(P)); continue; } else { // Ignore the PCH if not first on command line and emit warning. D.Diag(diag::warn_drv_pch_not_first_include) << P << A->getAsString(Args); } } } else if (A->getOption().matches(options::OPT_isystem_after)) { // Handling of paths which must come late. These entries are handled by // the toolchain itself after the resource dir is inserted in the right // search order. // Do not claim the argument so that the use of the argument does not // silently go unnoticed on toolchains which do not honour the option. continue; } // Not translated, render as usual. A->claim(); A->render(Args, CmdArgs); } Args.AddAllArgs(CmdArgs, {options::OPT_D, options::OPT_U, options::OPT_I_Group, options::OPT_F, options::OPT_index_header_map}); // Add -Wp, and -Xpreprocessor if using the preprocessor. // FIXME: There is a very unfortunate problem here, some troubled // souls abuse -Wp, to pass preprocessor options in gcc syntax. To // really support that we would have to parse and then translate // those options. :( Args.AddAllArgValues(CmdArgs, options::OPT_Wp_COMMA, options::OPT_Xpreprocessor); // -I- is a deprecated GCC feature, reject it. if (Arg *A = Args.getLastArg(options::OPT_I_)) D.Diag(diag::err_drv_I_dash_not_supported) << A->getAsString(Args); // If we have a --sysroot, and don't have an explicit -isysroot flag, add an // -isysroot to the CC1 invocation. StringRef sysroot = C.getSysRoot(); if (sysroot != "") { if (!Args.hasArg(options::OPT_isysroot)) { CmdArgs.push_back("-isysroot"); CmdArgs.push_back(C.getArgs().MakeArgString(sysroot)); } } // Parse additional include paths from environment variables. // FIXME: We should probably sink the logic for handling these from the // frontend into the driver. It will allow deleting 4 otherwise unused flags. // CPATH - included following the user specified includes (but prior to // builtin and standard includes). addDirectoryList(Args, CmdArgs, "-I", "CPATH"); // C_INCLUDE_PATH - system includes enabled when compiling C. addDirectoryList(Args, CmdArgs, "-c-isystem", "C_INCLUDE_PATH"); // CPLUS_INCLUDE_PATH - system includes enabled when compiling C++. addDirectoryList(Args, CmdArgs, "-cxx-isystem", "CPLUS_INCLUDE_PATH"); // OBJC_INCLUDE_PATH - system includes enabled when compiling ObjC. addDirectoryList(Args, CmdArgs, "-objc-isystem", "OBJC_INCLUDE_PATH"); // OBJCPLUS_INCLUDE_PATH - system includes enabled when compiling ObjC++. addDirectoryList(Args, CmdArgs, "-objcxx-isystem", "OBJCPLUS_INCLUDE_PATH"); // While adding the include arguments, we also attempt to retrieve the // arguments of related offloading toolchains or arguments that are specific // of an offloading programming model. // Add C++ include arguments, if needed. if (types::isCXX(Inputs[0].getType())) forAllAssociatedToolChains(C, JA, getToolChain(), [&Args, &CmdArgs](const ToolChain &TC) { TC.AddClangCXXStdlibIncludeArgs(Args, CmdArgs); }); // Add system include arguments for all targets but IAMCU. if (!IsIAMCU) forAllAssociatedToolChains(C, JA, getToolChain(), [&Args, &CmdArgs](const ToolChain &TC) { TC.AddClangSystemIncludeArgs(Args, CmdArgs); }); else { // For IAMCU add special include arguments. getToolChain().AddIAMCUIncludeArgs(Args, CmdArgs); } } // FIXME: Move to target hook. static bool isSignedCharDefault(const llvm::Triple &Triple) { switch (Triple.getArch()) { default: return true; case llvm::Triple::aarch64: case llvm::Triple::aarch64_be: case llvm::Triple::arm: case llvm::Triple::armeb: case llvm::Triple::thumb: case llvm::Triple::thumbeb: if (Triple.isOSDarwin() || Triple.isOSWindows()) return true; return false; case llvm::Triple::ppc: case llvm::Triple::ppc64: if (Triple.isOSDarwin()) return true; return false; case llvm::Triple::hexagon: case llvm::Triple::ppc64le: case llvm::Triple::riscv32: case llvm::Triple::riscv64: case llvm::Triple::systemz: case llvm::Triple::xcore: return false; } } static bool isNoCommonDefault(const llvm::Triple &Triple) { switch (Triple.getArch()) { default: if (Triple.isOSFuchsia()) return true; return false; case llvm::Triple::xcore: case llvm::Triple::wasm32: case llvm::Triple::wasm64: return true; } } void Clang::AddARMTargetArgs(const llvm::Triple &Triple, const ArgList &Args, ArgStringList &CmdArgs, bool KernelOrKext) const { // Select the ABI to use. // FIXME: Support -meabi. // FIXME: Parts of this are duplicated in the backend, unify this somehow. const char *ABIName = nullptr; if (Arg *A = Args.getLastArg(options::OPT_mabi_EQ)) ABIName = A->getValue(); else { std::string CPU = getCPUName(Args, Triple, /*FromAs*/ false); ABIName = llvm::ARM::computeDefaultTargetABI(Triple, CPU).data(); } CmdArgs.push_back("-target-abi"); CmdArgs.push_back(ABIName); // Determine floating point ABI from the options & target defaults. arm::FloatABI ABI = arm::getARMFloatABI(getToolChain(), Args); if (ABI == arm::FloatABI::Soft) { // Floating point operations and argument passing are soft. // FIXME: This changes CPP defines, we need -target-soft-float. CmdArgs.push_back("-msoft-float"); CmdArgs.push_back("-mfloat-abi"); CmdArgs.push_back("soft"); } else if (ABI == arm::FloatABI::SoftFP) { // Floating point operations are hard, but argument passing is soft. CmdArgs.push_back("-mfloat-abi"); CmdArgs.push_back("soft"); } else { // Floating point operations and argument passing are hard. assert(ABI == arm::FloatABI::Hard && "Invalid float abi!"); CmdArgs.push_back("-mfloat-abi"); CmdArgs.push_back("hard"); } // Forward the -mglobal-merge option for explicit control over the pass. if (Arg *A = Args.getLastArg(options::OPT_mglobal_merge, options::OPT_mno_global_merge)) { CmdArgs.push_back("-mllvm"); if (A->getOption().matches(options::OPT_mno_global_merge)) CmdArgs.push_back("-arm-global-merge=false"); else CmdArgs.push_back("-arm-global-merge=true"); } if (!Args.hasFlag(options::OPT_mimplicit_float, options::OPT_mno_implicit_float, true)) CmdArgs.push_back("-no-implicit-float"); } void Clang::RenderTargetOptions(const llvm::Triple &EffectiveTriple, const ArgList &Args, bool KernelOrKext, ArgStringList &CmdArgs) const { const ToolChain &TC = getToolChain(); // Add the target features getTargetFeatures(TC, EffectiveTriple, Args, CmdArgs, false); // Add target specific flags. switch (TC.getArch()) { default: break; case llvm::Triple::arm: case llvm::Triple::armeb: case llvm::Triple::thumb: case llvm::Triple::thumbeb: // Use the effective triple, which takes into account the deployment target. AddARMTargetArgs(EffectiveTriple, Args, CmdArgs, KernelOrKext); CmdArgs.push_back("-fallow-half-arguments-and-returns"); break; case llvm::Triple::aarch64: case llvm::Triple::aarch64_be: AddAArch64TargetArgs(Args, CmdArgs); CmdArgs.push_back("-fallow-half-arguments-and-returns"); break; case llvm::Triple::mips: case llvm::Triple::mipsel: case llvm::Triple::mips64: case llvm::Triple::mips64el: AddMIPSTargetArgs(Args, CmdArgs); break; case llvm::Triple::ppc: case llvm::Triple::ppc64: case llvm::Triple::ppc64le: AddPPCTargetArgs(Args, CmdArgs); break; case llvm::Triple::riscv32: case llvm::Triple::riscv64: AddRISCVTargetArgs(Args, CmdArgs); break; case llvm::Triple::sparc: case llvm::Triple::sparcel: case llvm::Triple::sparcv9: AddSparcTargetArgs(Args, CmdArgs); break; case llvm::Triple::systemz: AddSystemZTargetArgs(Args, CmdArgs); break; case llvm::Triple::x86: case llvm::Triple::x86_64: AddX86TargetArgs(Args, CmdArgs); break; case llvm::Triple::lanai: AddLanaiTargetArgs(Args, CmdArgs); break; case llvm::Triple::hexagon: AddHexagonTargetArgs(Args, CmdArgs); break; case llvm::Triple::wasm32: case llvm::Triple::wasm64: AddWebAssemblyTargetArgs(Args, CmdArgs); break; } } void Clang::AddAArch64TargetArgs(const ArgList &Args, ArgStringList &CmdArgs) const { const llvm::Triple &Triple = getToolChain().getEffectiveTriple(); if (!Args.hasFlag(options::OPT_mred_zone, options::OPT_mno_red_zone, true) || Args.hasArg(options::OPT_mkernel) || Args.hasArg(options::OPT_fapple_kext)) CmdArgs.push_back("-disable-red-zone"); if (!Args.hasFlag(options::OPT_mimplicit_float, options::OPT_mno_implicit_float, true)) CmdArgs.push_back("-no-implicit-float"); const char *ABIName = nullptr; if (Arg *A = Args.getLastArg(options::OPT_mabi_EQ)) ABIName = A->getValue(); else if (Triple.isOSDarwin()) ABIName = "darwinpcs"; else ABIName = "aapcs"; CmdArgs.push_back("-target-abi"); CmdArgs.push_back(ABIName); if (Arg *A = Args.getLastArg(options::OPT_mfix_cortex_a53_835769, options::OPT_mno_fix_cortex_a53_835769)) { CmdArgs.push_back("-mllvm"); if (A->getOption().matches(options::OPT_mfix_cortex_a53_835769)) CmdArgs.push_back("-aarch64-fix-cortex-a53-835769=1"); else CmdArgs.push_back("-aarch64-fix-cortex-a53-835769=0"); } else if (Triple.isAndroid()) { // Enabled A53 errata (835769) workaround by default on android CmdArgs.push_back("-mllvm"); CmdArgs.push_back("-aarch64-fix-cortex-a53-835769=1"); } // Forward the -mglobal-merge option for explicit control over the pass. if (Arg *A = Args.getLastArg(options::OPT_mglobal_merge, options::OPT_mno_global_merge)) { CmdArgs.push_back("-mllvm"); if (A->getOption().matches(options::OPT_mno_global_merge)) CmdArgs.push_back("-aarch64-enable-global-merge=false"); else CmdArgs.push_back("-aarch64-enable-global-merge=true"); } } void Clang::AddMIPSTargetArgs(const ArgList &Args, ArgStringList &CmdArgs) const { const Driver &D = getToolChain().getDriver(); StringRef CPUName; StringRef ABIName; const llvm::Triple &Triple = getToolChain().getTriple(); mips::getMipsCPUAndABI(Args, Triple, CPUName, ABIName); CmdArgs.push_back("-target-abi"); CmdArgs.push_back(ABIName.data()); mips::FloatABI ABI = mips::getMipsFloatABI(D, Args); if (ABI == mips::FloatABI::Soft) { // Floating point operations and argument passing are soft. CmdArgs.push_back("-msoft-float"); CmdArgs.push_back("-mfloat-abi"); CmdArgs.push_back("soft"); } else { // Floating point operations and argument passing are hard. assert(ABI == mips::FloatABI::Hard && "Invalid float abi!"); CmdArgs.push_back("-mfloat-abi"); CmdArgs.push_back("hard"); } if (Arg *A = Args.getLastArg(options::OPT_mxgot, options::OPT_mno_xgot)) { if (A->getOption().matches(options::OPT_mxgot)) { CmdArgs.push_back("-mllvm"); CmdArgs.push_back("-mxgot"); } } if (Arg *A = Args.getLastArg(options::OPT_mldc1_sdc1, options::OPT_mno_ldc1_sdc1)) { if (A->getOption().matches(options::OPT_mno_ldc1_sdc1)) { CmdArgs.push_back("-mllvm"); CmdArgs.push_back("-mno-ldc1-sdc1"); } } if (Arg *A = Args.getLastArg(options::OPT_mcheck_zero_division, options::OPT_mno_check_zero_division)) { if (A->getOption().matches(options::OPT_mno_check_zero_division)) { CmdArgs.push_back("-mllvm"); CmdArgs.push_back("-mno-check-zero-division"); } } if (Arg *A = Args.getLastArg(options::OPT_G)) { StringRef v = A->getValue(); CmdArgs.push_back("-mllvm"); CmdArgs.push_back(Args.MakeArgString("-mips-ssection-threshold=" + v)); A->claim(); } Arg *GPOpt = Args.getLastArg(options::OPT_mgpopt, options::OPT_mno_gpopt); Arg *ABICalls = Args.getLastArg(options::OPT_mabicalls, options::OPT_mno_abicalls); // -mabicalls is the default for many MIPS environments, even with -fno-pic. // -mgpopt is the default for static, -fno-pic environments but these two // options conflict. We want to be certain that -mno-abicalls -mgpopt is // the only case where -mllvm -mgpopt is passed. // NOTE: We need a warning here or in the backend to warn when -mgpopt is // passed explicitly when compiling something with -mabicalls // (implictly) in affect. Currently the warning is in the backend. // // When the ABI in use is N64, we also need to determine the PIC mode that // is in use, as -fno-pic for N64 implies -mno-abicalls. bool NoABICalls = ABICalls && ABICalls->getOption().matches(options::OPT_mno_abicalls); llvm::Reloc::Model RelocationModel; unsigned PICLevel; bool IsPIE; std::tie(RelocationModel, PICLevel, IsPIE) = ParsePICArgs(getToolChain(), Args); NoABICalls = NoABICalls || (RelocationModel == llvm::Reloc::Static && ABIName == "n64"); bool WantGPOpt = GPOpt && GPOpt->getOption().matches(options::OPT_mgpopt); // We quietly ignore -mno-gpopt as the backend defaults to -mno-gpopt. if (NoABICalls && (!GPOpt || WantGPOpt)) { CmdArgs.push_back("-mllvm"); CmdArgs.push_back("-mgpopt"); Arg *LocalSData = Args.getLastArg(options::OPT_mlocal_sdata, options::OPT_mno_local_sdata); Arg *ExternSData = Args.getLastArg(options::OPT_mextern_sdata, options::OPT_mno_extern_sdata); Arg *EmbeddedData = Args.getLastArg(options::OPT_membedded_data, options::OPT_mno_embedded_data); if (LocalSData) { CmdArgs.push_back("-mllvm"); if (LocalSData->getOption().matches(options::OPT_mlocal_sdata)) { CmdArgs.push_back("-mlocal-sdata=1"); } else { CmdArgs.push_back("-mlocal-sdata=0"); } LocalSData->claim(); } if (ExternSData) { CmdArgs.push_back("-mllvm"); if (ExternSData->getOption().matches(options::OPT_mextern_sdata)) { CmdArgs.push_back("-mextern-sdata=1"); } else { CmdArgs.push_back("-mextern-sdata=0"); } ExternSData->claim(); } if (EmbeddedData) { CmdArgs.push_back("-mllvm"); if (EmbeddedData->getOption().matches(options::OPT_membedded_data)) { CmdArgs.push_back("-membedded-data=1"); } else { CmdArgs.push_back("-membedded-data=0"); } EmbeddedData->claim(); } } else if ((!ABICalls || (!NoABICalls && ABICalls)) && WantGPOpt) D.Diag(diag::warn_drv_unsupported_gpopt) << (ABICalls ? 0 : 1); if (GPOpt) GPOpt->claim(); if (Arg *A = Args.getLastArg(options::OPT_mcompact_branches_EQ)) { StringRef Val = StringRef(A->getValue()); if (mips::hasCompactBranches(CPUName)) { if (Val == "never" || Val == "always" || Val == "optimal") { CmdArgs.push_back("-mllvm"); CmdArgs.push_back(Args.MakeArgString("-mips-compact-branches=" + Val)); } else D.Diag(diag::err_drv_unsupported_option_argument) << A->getOption().getName() << Val; } else D.Diag(diag::warn_target_unsupported_compact_branches) << CPUName; } } void Clang::AddPPCTargetArgs(const ArgList &Args, ArgStringList &CmdArgs) const { // Select the ABI to use. const char *ABIName = nullptr; if (getToolChain().getTriple().isOSLinux()) switch (getToolChain().getArch()) { case llvm::Triple::ppc64: { // When targeting a processor that supports QPX, or if QPX is // specifically enabled, default to using the ABI that supports QPX (so // long as it is not specifically disabled). bool HasQPX = false; if (Arg *A = Args.getLastArg(options::OPT_mcpu_EQ)) HasQPX = A->getValue() == StringRef("a2q"); HasQPX = Args.hasFlag(options::OPT_mqpx, options::OPT_mno_qpx, HasQPX); if (HasQPX) { ABIName = "elfv1-qpx"; break; } ABIName = "elfv1"; break; } case llvm::Triple::ppc64le: ABIName = "elfv2"; break; default: break; } if (Arg *A = Args.getLastArg(options::OPT_mabi_EQ)) // The ppc64 linux abis are all "altivec" abis by default. Accept and ignore // the option if given as we don't have backend support for any targets // that don't use the altivec abi. if (StringRef(A->getValue()) != "altivec") ABIName = A->getValue(); ppc::FloatABI FloatABI = ppc::getPPCFloatABI(getToolChain().getDriver(), Args); if (FloatABI == ppc::FloatABI::Soft) { // Floating point operations and argument passing are soft. CmdArgs.push_back("-msoft-float"); CmdArgs.push_back("-mfloat-abi"); CmdArgs.push_back("soft"); } else { // Floating point operations and argument passing are hard. assert(FloatABI == ppc::FloatABI::Hard && "Invalid float abi!"); CmdArgs.push_back("-mfloat-abi"); CmdArgs.push_back("hard"); } if (ABIName) { CmdArgs.push_back("-target-abi"); CmdArgs.push_back(ABIName); } } void Clang::AddRISCVTargetArgs(const ArgList &Args, ArgStringList &CmdArgs) const { // FIXME: currently defaults to the soft-float ABIs. Will need to be // expanded to select ilp32f, ilp32d, lp64f, lp64d when appropriate. const char *ABIName = nullptr; const llvm::Triple &Triple = getToolChain().getTriple(); if (Arg *A = Args.getLastArg(options::OPT_mabi_EQ)) ABIName = A->getValue(); else if (Triple.getArch() == llvm::Triple::riscv32) ABIName = "ilp32"; else if (Triple.getArch() == llvm::Triple::riscv64) ABIName = "lp64"; else llvm_unreachable("Unexpected triple!"); CmdArgs.push_back("-target-abi"); CmdArgs.push_back(ABIName); } void Clang::AddSparcTargetArgs(const ArgList &Args, ArgStringList &CmdArgs) const { sparc::FloatABI FloatABI = sparc::getSparcFloatABI(getToolChain().getDriver(), Args); if (FloatABI == sparc::FloatABI::Soft) { // Floating point operations and argument passing are soft. CmdArgs.push_back("-msoft-float"); CmdArgs.push_back("-mfloat-abi"); CmdArgs.push_back("soft"); } else { // Floating point operations and argument passing are hard. assert(FloatABI == sparc::FloatABI::Hard && "Invalid float abi!"); CmdArgs.push_back("-mfloat-abi"); CmdArgs.push_back("hard"); } } void Clang::AddSystemZTargetArgs(const ArgList &Args, ArgStringList &CmdArgs) const { if (Args.hasFlag(options::OPT_mbackchain, options::OPT_mno_backchain, false)) CmdArgs.push_back("-mbackchain"); } void Clang::AddX86TargetArgs(const ArgList &Args, ArgStringList &CmdArgs) const { if (!Args.hasFlag(options::OPT_mred_zone, options::OPT_mno_red_zone, true) || Args.hasArg(options::OPT_mkernel) || Args.hasArg(options::OPT_fapple_kext)) CmdArgs.push_back("-disable-red-zone"); // Default to avoid implicit floating-point for kernel/kext code, but allow // that to be overridden with -mno-soft-float. bool NoImplicitFloat = (Args.hasArg(options::OPT_mkernel) || Args.hasArg(options::OPT_fapple_kext)); if (Arg *A = Args.getLastArg( options::OPT_msoft_float, options::OPT_mno_soft_float, options::OPT_mimplicit_float, options::OPT_mno_implicit_float)) { const Option &O = A->getOption(); NoImplicitFloat = (O.matches(options::OPT_mno_implicit_float) || O.matches(options::OPT_msoft_float)); } if (NoImplicitFloat) CmdArgs.push_back("-no-implicit-float"); if (Arg *A = Args.getLastArg(options::OPT_masm_EQ)) { StringRef Value = A->getValue(); if (Value == "intel" || Value == "att") { CmdArgs.push_back("-mllvm"); CmdArgs.push_back(Args.MakeArgString("-x86-asm-syntax=" + Value)); } else { getToolChain().getDriver().Diag(diag::err_drv_unsupported_option_argument) << A->getOption().getName() << Value; } } else if (getToolChain().getDriver().IsCLMode()) { CmdArgs.push_back("-mllvm"); CmdArgs.push_back("-x86-asm-syntax=intel"); } // Set flags to support MCU ABI. if (Args.hasFlag(options::OPT_miamcu, options::OPT_mno_iamcu, false)) { CmdArgs.push_back("-mfloat-abi"); CmdArgs.push_back("soft"); CmdArgs.push_back("-mstack-alignment=4"); } } void Clang::AddHexagonTargetArgs(const ArgList &Args, ArgStringList &CmdArgs) const { CmdArgs.push_back("-mqdsp6-compat"); CmdArgs.push_back("-Wreturn-type"); if (auto G = toolchains::HexagonToolChain::getSmallDataThreshold(Args)) { CmdArgs.push_back("-mllvm"); CmdArgs.push_back(Args.MakeArgString("-hexagon-small-data-threshold=" + Twine(G.getValue()))); } if (!Args.hasArg(options::OPT_fno_short_enums)) CmdArgs.push_back("-fshort-enums"); if (Args.getLastArg(options::OPT_mieee_rnd_near)) { CmdArgs.push_back("-mllvm"); CmdArgs.push_back("-enable-hexagon-ieee-rnd-near"); } CmdArgs.push_back("-mllvm"); CmdArgs.push_back("-machine-sink-split=0"); } void Clang::AddLanaiTargetArgs(const ArgList &Args, ArgStringList &CmdArgs) const { if (Arg *A = Args.getLastArg(options::OPT_mcpu_EQ)) { StringRef CPUName = A->getValue(); CmdArgs.push_back("-target-cpu"); CmdArgs.push_back(Args.MakeArgString(CPUName)); } if (Arg *A = Args.getLastArg(options::OPT_mregparm_EQ)) { StringRef Value = A->getValue(); // Only support mregparm=4 to support old usage. Report error for all other // cases. int Mregparm; if (Value.getAsInteger(10, Mregparm)) { if (Mregparm != 4) { getToolChain().getDriver().Diag( diag::err_drv_unsupported_option_argument) << A->getOption().getName() << Value; } } } } void Clang::AddWebAssemblyTargetArgs(const ArgList &Args, ArgStringList &CmdArgs) const { // Default to "hidden" visibility. if (!Args.hasArg(options::OPT_fvisibility_EQ, options::OPT_fvisibility_ms_compat)) { CmdArgs.push_back("-fvisibility"); CmdArgs.push_back("hidden"); } } void Clang::DumpCompilationDatabase(Compilation &C, StringRef Filename, StringRef Target, const InputInfo &Output, const InputInfo &Input, const ArgList &Args) const { // If this is a dry run, do not create the compilation database file. if (C.getArgs().hasArg(options::OPT__HASH_HASH_HASH)) return; using llvm::yaml::escape; const Driver &D = getToolChain().getDriver(); if (!CompilationDatabase) { std::error_code EC; auto File = llvm::make_unique(Filename, EC, llvm::sys::fs::F_Text); if (EC) { D.Diag(clang::diag::err_drv_compilationdatabase) << Filename << EC.message(); return; } CompilationDatabase = std::move(File); } auto &CDB = *CompilationDatabase; SmallString<128> Buf; if (llvm::sys::fs::current_path(Buf)) Buf = "."; CDB << "{ \"directory\": \"" << escape(Buf) << "\""; CDB << ", \"file\": \"" << escape(Input.getFilename()) << "\""; CDB << ", \"output\": \"" << escape(Output.getFilename()) << "\""; CDB << ", \"arguments\": [\"" << escape(D.ClangExecutable) << "\""; Buf = "-x"; Buf += types::getTypeName(Input.getType()); CDB << ", \"" << escape(Buf) << "\""; if (!D.SysRoot.empty() && !Args.hasArg(options::OPT__sysroot_EQ)) { Buf = "--sysroot="; Buf += D.SysRoot; CDB << ", \"" << escape(Buf) << "\""; } CDB << ", \"" << escape(Input.getFilename()) << "\""; for (auto &A: Args) { auto &O = A->getOption(); // Skip language selection, which is positional. if (O.getID() == options::OPT_x) continue; // Skip writing dependency output and the compilation database itself. if (O.getGroup().isValid() && O.getGroup().getID() == options::OPT_M_Group) continue; // Skip inputs. if (O.getKind() == Option::InputClass) continue; // All other arguments are quoted and appended. ArgStringList ASL; A->render(Args, ASL); for (auto &it: ASL) CDB << ", \"" << escape(it) << "\""; } Buf = "--target="; Buf += Target; CDB << ", \"" << escape(Buf) << "\"]},\n"; } static void CollectArgsForIntegratedAssembler(Compilation &C, const ArgList &Args, ArgStringList &CmdArgs, const Driver &D) { if (UseRelaxAll(C, Args)) CmdArgs.push_back("-mrelax-all"); // Only default to -mincremental-linker-compatible if we think we are // targeting the MSVC linker. bool DefaultIncrementalLinkerCompatible = C.getDefaultToolChain().getTriple().isWindowsMSVCEnvironment(); if (Args.hasFlag(options::OPT_mincremental_linker_compatible, options::OPT_mno_incremental_linker_compatible, DefaultIncrementalLinkerCompatible)) CmdArgs.push_back("-mincremental-linker-compatible"); switch (C.getDefaultToolChain().getArch()) { case llvm::Triple::arm: case llvm::Triple::armeb: case llvm::Triple::thumb: case llvm::Triple::thumbeb: if (Arg *A = Args.getLastArg(options::OPT_mimplicit_it_EQ)) { StringRef Value = A->getValue(); if (Value == "always" || Value == "never" || Value == "arm" || Value == "thumb") { CmdArgs.push_back("-mllvm"); CmdArgs.push_back(Args.MakeArgString("-arm-implicit-it=" + Value)); } else { D.Diag(diag::err_drv_unsupported_option_argument) << A->getOption().getName() << Value; } } break; default: break; } // When passing -I arguments to the assembler we sometimes need to // unconditionally take the next argument. For example, when parsing // '-Wa,-I -Wa,foo' we need to accept the -Wa,foo arg after seeing the // -Wa,-I arg and when parsing '-Wa,-I,foo' we need to accept the 'foo' // arg after parsing the '-I' arg. bool TakeNextArg = false; bool UseRelaxRelocations = C.getDefaultToolChain().useRelaxRelocations(); const char *MipsTargetFeature = nullptr; for (const Arg *A : Args.filtered(options::OPT_Wa_COMMA, options::OPT_Xassembler)) { A->claim(); for (StringRef Value : A->getValues()) { if (TakeNextArg) { CmdArgs.push_back(Value.data()); TakeNextArg = false; continue; } if (C.getDefaultToolChain().getTriple().isOSBinFormatCOFF() && Value == "-mbig-obj") continue; // LLVM handles bigobj automatically switch (C.getDefaultToolChain().getArch()) { default: break; case llvm::Triple::thumb: case llvm::Triple::thumbeb: case llvm::Triple::arm: case llvm::Triple::armeb: if (Value == "-mthumb") // -mthumb has already been processed in ComputeLLVMTriple() // recognize but skip over here. continue; break; case llvm::Triple::mips: case llvm::Triple::mipsel: case llvm::Triple::mips64: case llvm::Triple::mips64el: if (Value == "--trap") { CmdArgs.push_back("-target-feature"); CmdArgs.push_back("+use-tcc-in-div"); continue; } if (Value == "--break") { CmdArgs.push_back("-target-feature"); CmdArgs.push_back("-use-tcc-in-div"); continue; } if (Value.startswith("-msoft-float")) { CmdArgs.push_back("-target-feature"); CmdArgs.push_back("+soft-float"); continue; } if (Value.startswith("-mhard-float")) { CmdArgs.push_back("-target-feature"); CmdArgs.push_back("-soft-float"); continue; } MipsTargetFeature = llvm::StringSwitch(Value) .Case("-mips1", "+mips1") .Case("-mips2", "+mips2") .Case("-mips3", "+mips3") .Case("-mips4", "+mips4") .Case("-mips5", "+mips5") .Case("-mips32", "+mips32") .Case("-mips32r2", "+mips32r2") .Case("-mips32r3", "+mips32r3") .Case("-mips32r5", "+mips32r5") .Case("-mips32r6", "+mips32r6") .Case("-mips64", "+mips64") .Case("-mips64r2", "+mips64r2") .Case("-mips64r3", "+mips64r3") .Case("-mips64r5", "+mips64r5") .Case("-mips64r6", "+mips64r6") .Default(nullptr); if (MipsTargetFeature) continue; } if (Value == "-force_cpusubtype_ALL") { // Do nothing, this is the default and we don't support anything else. } else if (Value == "-L") { CmdArgs.push_back("-msave-temp-labels"); } else if (Value == "--fatal-warnings") { CmdArgs.push_back("-massembler-fatal-warnings"); } else if (Value == "--noexecstack") { CmdArgs.push_back("-mnoexecstack"); } else if (Value.startswith("-compress-debug-sections") || Value.startswith("--compress-debug-sections") || Value == "-nocompress-debug-sections" || Value == "--nocompress-debug-sections") { CmdArgs.push_back(Value.data()); } else if (Value == "-mrelax-relocations=yes" || Value == "--mrelax-relocations=yes") { UseRelaxRelocations = true; } else if (Value == "-mrelax-relocations=no" || Value == "--mrelax-relocations=no") { UseRelaxRelocations = false; } else if (Value.startswith("-I")) { CmdArgs.push_back(Value.data()); // We need to consume the next argument if the current arg is a plain // -I. The next arg will be the include directory. if (Value == "-I") TakeNextArg = true; } else if (Value.startswith("-gdwarf-")) { // "-gdwarf-N" options are not cc1as options. unsigned DwarfVersion = DwarfVersionNum(Value); if (DwarfVersion == 0) { // Send it onward, and let cc1as complain. CmdArgs.push_back(Value.data()); } else { RenderDebugEnablingArgs(Args, CmdArgs, codegenoptions::LimitedDebugInfo, DwarfVersion, llvm::DebuggerKind::Default); } } else if (Value.startswith("-mcpu") || Value.startswith("-mfpu") || Value.startswith("-mhwdiv") || Value.startswith("-march")) { // Do nothing, we'll validate it later. } else if (Value == "-defsym") { if (A->getNumValues() != 2) { D.Diag(diag::err_drv_defsym_invalid_format) << Value; break; } const char *S = A->getValue(1); auto Pair = StringRef(S).split('='); auto Sym = Pair.first; auto SVal = Pair.second; if (Sym.empty() || SVal.empty()) { D.Diag(diag::err_drv_defsym_invalid_format) << S; break; } int64_t IVal; if (SVal.getAsInteger(0, IVal)) { D.Diag(diag::err_drv_defsym_invalid_symval) << SVal; break; } CmdArgs.push_back(Value.data()); TakeNextArg = true; } else { D.Diag(diag::err_drv_unsupported_option_argument) << A->getOption().getName() << Value; } } } if (UseRelaxRelocations) CmdArgs.push_back("--mrelax-relocations"); if (MipsTargetFeature != nullptr) { CmdArgs.push_back("-target-feature"); CmdArgs.push_back(MipsTargetFeature); } } static void RenderFloatingPointOptions(const ToolChain &TC, const Driver &D, bool OFastEnabled, const ArgList &Args, ArgStringList &CmdArgs) { // Handle various floating point optimization flags, mapping them to the // appropriate LLVM code generation flags. This is complicated by several // "umbrella" flags, so we do this by stepping through the flags incrementally // adjusting what we think is enabled/disabled, then at the end setting the // LLVM flags based on the final state. bool HonorINFs = true; bool HonorNaNs = true; // -fmath-errno is the default on some platforms, e.g. BSD-derived OSes. bool MathErrno = TC.IsMathErrnoDefault(); bool AssociativeMath = false; bool ReciprocalMath = false; bool SignedZeros = true; bool TrappingMath = true; StringRef DenormalFPMath = ""; StringRef FPContract = ""; for (const Arg *A : Args) { switch (A->getOption().getID()) { // If this isn't an FP option skip the claim below default: continue; // Options controlling individual features case options::OPT_fhonor_infinities: HonorINFs = true; break; case options::OPT_fno_honor_infinities: HonorINFs = false; break; case options::OPT_fhonor_nans: HonorNaNs = true; break; case options::OPT_fno_honor_nans: HonorNaNs = false; break; case options::OPT_fmath_errno: MathErrno = true; break; case options::OPT_fno_math_errno: MathErrno = false; break; case options::OPT_fassociative_math: AssociativeMath = true; break; case options::OPT_fno_associative_math: AssociativeMath = false; break; case options::OPT_freciprocal_math: ReciprocalMath = true; break; case options::OPT_fno_reciprocal_math: ReciprocalMath = false; break; case options::OPT_fsigned_zeros: SignedZeros = true; break; case options::OPT_fno_signed_zeros: SignedZeros = false; break; case options::OPT_ftrapping_math: TrappingMath = true; break; case options::OPT_fno_trapping_math: TrappingMath = false; break; case options::OPT_fdenormal_fp_math_EQ: DenormalFPMath = A->getValue(); break; // Validate and pass through -fp-contract option. case options::OPT_ffp_contract: { StringRef Val = A->getValue(); if (Val == "fast" || Val == "on" || Val == "off") FPContract = Val; else D.Diag(diag::err_drv_unsupported_option_argument) << A->getOption().getName() << Val; break; } case options::OPT_ffinite_math_only: HonorINFs = false; HonorNaNs = false; break; case options::OPT_fno_finite_math_only: HonorINFs = true; HonorNaNs = true; break; case options::OPT_funsafe_math_optimizations: AssociativeMath = true; ReciprocalMath = true; SignedZeros = false; TrappingMath = false; break; case options::OPT_fno_unsafe_math_optimizations: AssociativeMath = false; ReciprocalMath = false; SignedZeros = true; TrappingMath = true; // -fno_unsafe_math_optimizations restores default denormal handling DenormalFPMath = ""; break; case options::OPT_Ofast: // If -Ofast is the optimization level, then -ffast-math should be enabled if (!OFastEnabled) continue; LLVM_FALLTHROUGH; case options::OPT_ffast_math: HonorINFs = false; HonorNaNs = false; MathErrno = false; AssociativeMath = true; ReciprocalMath = true; SignedZeros = false; TrappingMath = false; // If fast-math is set then set the fp-contract mode to fast. FPContract = "fast"; break; case options::OPT_fno_fast_math: HonorINFs = true; HonorNaNs = true; // Turning on -ffast-math (with either flag) removes the need for // MathErrno. However, turning *off* -ffast-math merely restores the // toolchain default (which may be false). MathErrno = TC.IsMathErrnoDefault(); AssociativeMath = false; ReciprocalMath = false; SignedZeros = true; TrappingMath = true; // -fno_fast_math restores default denormal and fpcontract handling DenormalFPMath = ""; FPContract = ""; break; } // If we handled this option claim it A->claim(); } if (!HonorINFs) CmdArgs.push_back("-menable-no-infs"); if (!HonorNaNs) CmdArgs.push_back("-menable-no-nans"); if (MathErrno) CmdArgs.push_back("-fmath-errno"); if (!MathErrno && AssociativeMath && ReciprocalMath && !SignedZeros && !TrappingMath) CmdArgs.push_back("-menable-unsafe-fp-math"); if (!SignedZeros) CmdArgs.push_back("-fno-signed-zeros"); if (AssociativeMath && !SignedZeros && !TrappingMath) CmdArgs.push_back("-mreassociate"); if (ReciprocalMath) CmdArgs.push_back("-freciprocal-math"); if (!TrappingMath) CmdArgs.push_back("-fno-trapping-math"); if (!DenormalFPMath.empty()) CmdArgs.push_back( Args.MakeArgString("-fdenormal-fp-math=" + DenormalFPMath)); if (!FPContract.empty()) CmdArgs.push_back(Args.MakeArgString("-ffp-contract=" + FPContract)); ParseMRecip(D, Args, CmdArgs); // -ffast-math enables the __FAST_MATH__ preprocessor macro, but check for the // individual features enabled by -ffast-math instead of the option itself as // that's consistent with gcc's behaviour. if (!HonorINFs && !HonorNaNs && !MathErrno && AssociativeMath && ReciprocalMath && !SignedZeros && !TrappingMath) CmdArgs.push_back("-ffast-math"); // Handle __FINITE_MATH_ONLY__ similarly. if (!HonorINFs && !HonorNaNs) CmdArgs.push_back("-ffinite-math-only"); if (const Arg *A = Args.getLastArg(options::OPT_mfpmath_EQ)) { CmdArgs.push_back("-mfpmath"); CmdArgs.push_back(A->getValue()); } // Disable a codegen optimization for floating-point casts. if (Args.hasFlag(options::OPT_fno_strict_float_cast_overflow, options::OPT_fstrict_float_cast_overflow, false)) CmdArgs.push_back("-fno-strict-float-cast-overflow"); } static void RenderAnalyzerOptions(const ArgList &Args, ArgStringList &CmdArgs, const llvm::Triple &Triple, const InputInfo &Input) { // Enable region store model by default. CmdArgs.push_back("-analyzer-store=region"); // Treat blocks as analysis entry points. CmdArgs.push_back("-analyzer-opt-analyze-nested-blocks"); CmdArgs.push_back("-analyzer-eagerly-assume"); // Add default argument set. if (!Args.hasArg(options::OPT__analyzer_no_default_checks)) { CmdArgs.push_back("-analyzer-checker=core"); CmdArgs.push_back("-analyzer-checker=apiModeling"); if (!Triple.isWindowsMSVCEnvironment()) { CmdArgs.push_back("-analyzer-checker=unix"); } else { // Enable "unix" checkers that also work on Windows. CmdArgs.push_back("-analyzer-checker=unix.API"); CmdArgs.push_back("-analyzer-checker=unix.Malloc"); CmdArgs.push_back("-analyzer-checker=unix.MallocSizeof"); CmdArgs.push_back("-analyzer-checker=unix.MismatchedDeallocator"); CmdArgs.push_back("-analyzer-checker=unix.cstring.BadSizeArg"); CmdArgs.push_back("-analyzer-checker=unix.cstring.NullArg"); } // Disable some unix checkers for PS4. if (Triple.isPS4CPU()) { CmdArgs.push_back("-analyzer-disable-checker=unix.API"); CmdArgs.push_back("-analyzer-disable-checker=unix.Vfork"); } if (Triple.isOSDarwin()) CmdArgs.push_back("-analyzer-checker=osx"); CmdArgs.push_back("-analyzer-checker=deadcode"); if (types::isCXX(Input.getType())) CmdArgs.push_back("-analyzer-checker=cplusplus"); if (!Triple.isPS4CPU()) { CmdArgs.push_back("-analyzer-checker=security.insecureAPI.UncheckedReturn"); CmdArgs.push_back("-analyzer-checker=security.insecureAPI.getpw"); CmdArgs.push_back("-analyzer-checker=security.insecureAPI.gets"); CmdArgs.push_back("-analyzer-checker=security.insecureAPI.mktemp"); CmdArgs.push_back("-analyzer-checker=security.insecureAPI.mkstemp"); CmdArgs.push_back("-analyzer-checker=security.insecureAPI.vfork"); } // Default nullability checks. CmdArgs.push_back("-analyzer-checker=nullability.NullPassedToNonnull"); CmdArgs.push_back("-analyzer-checker=nullability.NullReturnedFromNonnull"); } // Set the output format. The default is plist, for (lame) historical reasons. CmdArgs.push_back("-analyzer-output"); if (Arg *A = Args.getLastArg(options::OPT__analyzer_output)) CmdArgs.push_back(A->getValue()); else CmdArgs.push_back("plist"); // Disable the presentation of standard compiler warnings when using // --analyze. We only want to show static analyzer diagnostics or frontend // errors. CmdArgs.push_back("-w"); // Add -Xanalyzer arguments when running as analyzer. Args.AddAllArgValues(CmdArgs, options::OPT_Xanalyzer); } static void RenderSSPOptions(const ToolChain &TC, const ArgList &Args, ArgStringList &CmdArgs, bool KernelOrKext) { const llvm::Triple &EffectiveTriple = TC.getEffectiveTriple(); // NVPTX doesn't support stack protectors; from the compiler's perspective, it // doesn't even have a stack! if (EffectiveTriple.isNVPTX()) return; // -stack-protector=0 is default. unsigned StackProtectorLevel = 0; unsigned DefaultStackProtectorLevel = TC.GetDefaultStackProtectorLevel(KernelOrKext); if (Arg *A = Args.getLastArg(options::OPT_fno_stack_protector, options::OPT_fstack_protector_all, options::OPT_fstack_protector_strong, options::OPT_fstack_protector)) { if (A->getOption().matches(options::OPT_fstack_protector)) StackProtectorLevel = std::max(LangOptions::SSPOn, DefaultStackProtectorLevel); else if (A->getOption().matches(options::OPT_fstack_protector_strong)) StackProtectorLevel = LangOptions::SSPStrong; else if (A->getOption().matches(options::OPT_fstack_protector_all)) StackProtectorLevel = LangOptions::SSPReq; } else { StackProtectorLevel = DefaultStackProtectorLevel; } if (StackProtectorLevel) { CmdArgs.push_back("-stack-protector"); CmdArgs.push_back(Args.MakeArgString(Twine(StackProtectorLevel))); } // --param ssp-buffer-size= for (const Arg *A : Args.filtered(options::OPT__param)) { StringRef Str(A->getValue()); if (Str.startswith("ssp-buffer-size=")) { if (StackProtectorLevel) { CmdArgs.push_back("-stack-protector-buffer-size"); // FIXME: Verify the argument is a valid integer. CmdArgs.push_back(Args.MakeArgString(Str.drop_front(16))); } A->claim(); } } } static void RenderOpenCLOptions(const ArgList &Args, ArgStringList &CmdArgs) { const unsigned ForwardedArguments[] = { options::OPT_cl_opt_disable, options::OPT_cl_strict_aliasing, options::OPT_cl_single_precision_constant, options::OPT_cl_finite_math_only, options::OPT_cl_kernel_arg_info, options::OPT_cl_unsafe_math_optimizations, options::OPT_cl_fast_relaxed_math, options::OPT_cl_mad_enable, options::OPT_cl_no_signed_zeros, options::OPT_cl_denorms_are_zero, options::OPT_cl_fp32_correctly_rounded_divide_sqrt, options::OPT_cl_uniform_work_group_size }; if (Arg *A = Args.getLastArg(options::OPT_cl_std_EQ)) { std::string CLStdStr = std::string("-cl-std=") + A->getValue(); CmdArgs.push_back(Args.MakeArgString(CLStdStr)); } for (const auto &Arg : ForwardedArguments) if (const auto *A = Args.getLastArg(Arg)) CmdArgs.push_back(Args.MakeArgString(A->getOption().getPrefixedName())); } static void RenderARCMigrateToolOptions(const Driver &D, const ArgList &Args, ArgStringList &CmdArgs) { bool ARCMTEnabled = false; if (!Args.hasArg(options::OPT_fno_objc_arc, options::OPT_fobjc_arc)) { if (const Arg *A = Args.getLastArg(options::OPT_ccc_arcmt_check, options::OPT_ccc_arcmt_modify, options::OPT_ccc_arcmt_migrate)) { ARCMTEnabled = true; switch (A->getOption().getID()) { default: llvm_unreachable("missed a case"); case options::OPT_ccc_arcmt_check: CmdArgs.push_back("-arcmt-check"); break; case options::OPT_ccc_arcmt_modify: CmdArgs.push_back("-arcmt-modify"); break; case options::OPT_ccc_arcmt_migrate: CmdArgs.push_back("-arcmt-migrate"); CmdArgs.push_back("-mt-migrate-directory"); CmdArgs.push_back(A->getValue()); Args.AddLastArg(CmdArgs, options::OPT_arcmt_migrate_report_output); Args.AddLastArg(CmdArgs, options::OPT_arcmt_migrate_emit_arc_errors); break; } } } else { Args.ClaimAllArgs(options::OPT_ccc_arcmt_check); Args.ClaimAllArgs(options::OPT_ccc_arcmt_modify); Args.ClaimAllArgs(options::OPT_ccc_arcmt_migrate); } if (const Arg *A = Args.getLastArg(options::OPT_ccc_objcmt_migrate)) { if (ARCMTEnabled) D.Diag(diag::err_drv_argument_not_allowed_with) << A->getAsString(Args) << "-ccc-arcmt-migrate"; CmdArgs.push_back("-mt-migrate-directory"); CmdArgs.push_back(A->getValue()); if (!Args.hasArg(options::OPT_objcmt_migrate_literals, options::OPT_objcmt_migrate_subscripting, options::OPT_objcmt_migrate_property)) { // None specified, means enable them all. CmdArgs.push_back("-objcmt-migrate-literals"); CmdArgs.push_back("-objcmt-migrate-subscripting"); CmdArgs.push_back("-objcmt-migrate-property"); } else { Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_literals); Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_subscripting); Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_property); } } else { Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_literals); Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_subscripting); Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_property); Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_all); Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_readonly_property); Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_readwrite_property); Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_property_dot_syntax); Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_annotation); Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_instancetype); Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_nsmacros); Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_protocol_conformance); Args.AddLastArg(CmdArgs, options::OPT_objcmt_atomic_property); Args.AddLastArg(CmdArgs, options::OPT_objcmt_returns_innerpointer_property); Args.AddLastArg(CmdArgs, options::OPT_objcmt_ns_nonatomic_iosonly); Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_designated_init); Args.AddLastArg(CmdArgs, options::OPT_objcmt_whitelist_dir_path); } } static void RenderBuiltinOptions(const ToolChain &TC, const llvm::Triple &T, const ArgList &Args, ArgStringList &CmdArgs) { // -fbuiltin is default unless -mkernel is used. bool UseBuiltins = Args.hasFlag(options::OPT_fbuiltin, options::OPT_fno_builtin, !Args.hasArg(options::OPT_mkernel)); if (!UseBuiltins) CmdArgs.push_back("-fno-builtin"); // -ffreestanding implies -fno-builtin. if (Args.hasArg(options::OPT_ffreestanding)) UseBuiltins = false; // Process the -fno-builtin-* options. for (const auto &Arg : Args) { const Option &O = Arg->getOption(); if (!O.matches(options::OPT_fno_builtin_)) continue; Arg->claim(); // If -fno-builtin is specified, then there's no need to pass the option to // the frontend. if (!UseBuiltins) continue; StringRef FuncName = Arg->getValue(); CmdArgs.push_back(Args.MakeArgString("-fno-builtin-" + FuncName)); } // le32-specific flags: // -fno-math-builtin: clang should not convert math builtins to intrinsics // by default. if (TC.getArch() == llvm::Triple::le32) CmdArgs.push_back("-fno-math-builtin"); } void Driver::getDefaultModuleCachePath(SmallVectorImpl &Result) { llvm::sys::path::system_temp_directory(/*erasedOnReboot=*/false, Result); llvm::sys::path::append(Result, "org.llvm.clang."); appendUserToPath(Result); llvm::sys::path::append(Result, "ModuleCache"); } static void RenderModulesOptions(Compilation &C, const Driver &D, const ArgList &Args, const InputInfo &Input, const InputInfo &Output, ArgStringList &CmdArgs, bool &HaveModules) { // -fmodules enables the use of precompiled modules (off by default). // Users can pass -fno-cxx-modules to turn off modules support for // C++/Objective-C++ programs. bool HaveClangModules = false; if (Args.hasFlag(options::OPT_fmodules, options::OPT_fno_modules, false)) { bool AllowedInCXX = Args.hasFlag(options::OPT_fcxx_modules, options::OPT_fno_cxx_modules, true); if (AllowedInCXX || !types::isCXX(Input.getType())) { CmdArgs.push_back("-fmodules"); HaveClangModules = true; } } HaveModules = HaveClangModules; if (Args.hasArg(options::OPT_fmodules_ts)) { CmdArgs.push_back("-fmodules-ts"); HaveModules = true; } // -fmodule-maps enables implicit reading of module map files. By default, // this is enabled if we are using Clang's flavor of precompiled modules. if (Args.hasFlag(options::OPT_fimplicit_module_maps, options::OPT_fno_implicit_module_maps, HaveClangModules)) CmdArgs.push_back("-fimplicit-module-maps"); // -fmodules-decluse checks that modules used are declared so (off by default) if (Args.hasFlag(options::OPT_fmodules_decluse, options::OPT_fno_modules_decluse, false)) CmdArgs.push_back("-fmodules-decluse"); // -fmodules-strict-decluse is like -fmodule-decluse, but also checks that // all #included headers are part of modules. if (Args.hasFlag(options::OPT_fmodules_strict_decluse, options::OPT_fno_modules_strict_decluse, false)) CmdArgs.push_back("-fmodules-strict-decluse"); // -fno-implicit-modules turns off implicitly compiling modules on demand. bool ImplicitModules = false; if (!Args.hasFlag(options::OPT_fimplicit_modules, options::OPT_fno_implicit_modules, HaveClangModules)) { if (HaveModules) CmdArgs.push_back("-fno-implicit-modules"); } else if (HaveModules) { ImplicitModules = true; // -fmodule-cache-path specifies where our implicitly-built module files // should be written. SmallString<128> Path; if (Arg *A = Args.getLastArg(options::OPT_fmodules_cache_path)) Path = A->getValue(); if (C.isForDiagnostics()) { // When generating crash reports, we want to emit the modules along with // the reproduction sources, so we ignore any provided module path. Path = Output.getFilename(); llvm::sys::path::replace_extension(Path, ".cache"); llvm::sys::path::append(Path, "modules"); } else if (Path.empty()) { // No module path was provided: use the default. Driver::getDefaultModuleCachePath(Path); } const char Arg[] = "-fmodules-cache-path="; Path.insert(Path.begin(), Arg, Arg + strlen(Arg)); CmdArgs.push_back(Args.MakeArgString(Path)); } if (HaveModules) { // -fprebuilt-module-path specifies where to load the prebuilt module files. for (const Arg *A : Args.filtered(options::OPT_fprebuilt_module_path)) { CmdArgs.push_back(Args.MakeArgString( std::string("-fprebuilt-module-path=") + A->getValue())); A->claim(); } } // -fmodule-name specifies the module that is currently being built (or // used for header checking by -fmodule-maps). Args.AddLastArg(CmdArgs, options::OPT_fmodule_name_EQ); // -fmodule-map-file can be used to specify files containing module // definitions. Args.AddAllArgs(CmdArgs, options::OPT_fmodule_map_file); // -fbuiltin-module-map can be used to load the clang // builtin headers modulemap file. if (Args.hasArg(options::OPT_fbuiltin_module_map)) { SmallString<128> BuiltinModuleMap(D.ResourceDir); llvm::sys::path::append(BuiltinModuleMap, "include"); llvm::sys::path::append(BuiltinModuleMap, "module.modulemap"); if (llvm::sys::fs::exists(BuiltinModuleMap)) CmdArgs.push_back( Args.MakeArgString("-fmodule-map-file=" + BuiltinModuleMap)); } // The -fmodule-file== form specifies the mapping of module // names to precompiled module files (the module is loaded only if used). // The -fmodule-file= form can be used to unconditionally load // precompiled module files (whether used or not). if (HaveModules) Args.AddAllArgs(CmdArgs, options::OPT_fmodule_file); else Args.ClaimAllArgs(options::OPT_fmodule_file); // When building modules and generating crashdumps, we need to dump a module // dependency VFS alongside the output. if (HaveClangModules && C.isForDiagnostics()) { SmallString<128> VFSDir(Output.getFilename()); llvm::sys::path::replace_extension(VFSDir, ".cache"); // Add the cache directory as a temp so the crash diagnostics pick it up. C.addTempFile(Args.MakeArgString(VFSDir)); llvm::sys::path::append(VFSDir, "vfs"); CmdArgs.push_back("-module-dependency-dir"); CmdArgs.push_back(Args.MakeArgString(VFSDir)); } if (HaveClangModules) Args.AddLastArg(CmdArgs, options::OPT_fmodules_user_build_path); // Pass through all -fmodules-ignore-macro arguments. Args.AddAllArgs(CmdArgs, options::OPT_fmodules_ignore_macro); Args.AddLastArg(CmdArgs, options::OPT_fmodules_prune_interval); Args.AddLastArg(CmdArgs, options::OPT_fmodules_prune_after); Args.AddLastArg(CmdArgs, options::OPT_fbuild_session_timestamp); if (Arg *A = Args.getLastArg(options::OPT_fbuild_session_file)) { if (Args.hasArg(options::OPT_fbuild_session_timestamp)) D.Diag(diag::err_drv_argument_not_allowed_with) << A->getAsString(Args) << "-fbuild-session-timestamp"; llvm::sys::fs::file_status Status; if (llvm::sys::fs::status(A->getValue(), Status)) D.Diag(diag::err_drv_no_such_file) << A->getValue(); CmdArgs.push_back( Args.MakeArgString("-fbuild-session-timestamp=" + Twine((uint64_t)Status.getLastModificationTime() .time_since_epoch() .count()))); } if (Args.getLastArg(options::OPT_fmodules_validate_once_per_build_session)) { if (!Args.getLastArg(options::OPT_fbuild_session_timestamp, options::OPT_fbuild_session_file)) D.Diag(diag::err_drv_modules_validate_once_requires_timestamp); Args.AddLastArg(CmdArgs, options::OPT_fmodules_validate_once_per_build_session); } if (Args.hasFlag(options::OPT_fmodules_validate_system_headers, options::OPT_fno_modules_validate_system_headers, ImplicitModules)) CmdArgs.push_back("-fmodules-validate-system-headers"); Args.AddLastArg(CmdArgs, options::OPT_fmodules_disable_diagnostic_validation); } static void RenderCharacterOptions(const ArgList &Args, const llvm::Triple &T, ArgStringList &CmdArgs) { // -fsigned-char is default. if (const Arg *A = Args.getLastArg(options::OPT_fsigned_char, options::OPT_fno_signed_char, options::OPT_funsigned_char, options::OPT_fno_unsigned_char)) { if (A->getOption().matches(options::OPT_funsigned_char) || A->getOption().matches(options::OPT_fno_signed_char)) { CmdArgs.push_back("-fno-signed-char"); } } else if (!isSignedCharDefault(T)) { CmdArgs.push_back("-fno-signed-char"); } if (Args.hasFlag(options::OPT_fchar8__t, options::OPT_fno_char8__t, false)) CmdArgs.push_back("-fchar8_t"); if (const Arg *A = Args.getLastArg(options::OPT_fshort_wchar, options::OPT_fno_short_wchar)) { if (A->getOption().matches(options::OPT_fshort_wchar)) { CmdArgs.push_back("-fwchar-type=short"); CmdArgs.push_back("-fno-signed-wchar"); } else { bool IsARM = T.isARM() || T.isThumb() || T.isAArch64(); CmdArgs.push_back("-fwchar-type=int"); if (IsARM && !(T.isOSWindows() || T.getOS() == llvm::Triple::NetBSD || T.getOS() == llvm::Triple::OpenBSD)) CmdArgs.push_back("-fno-signed-wchar"); else CmdArgs.push_back("-fsigned-wchar"); } } } static void RenderObjCOptions(const ToolChain &TC, const Driver &D, const llvm::Triple &T, const ArgList &Args, ObjCRuntime &Runtime, bool InferCovariantReturns, const InputInfo &Input, ArgStringList &CmdArgs) { const llvm::Triple::ArchType Arch = TC.getArch(); // -fobjc-dispatch-method is only relevant with the nonfragile-abi, and legacy // is the default. Except for deployment target of 10.5, next runtime is // always legacy dispatch and -fno-objc-legacy-dispatch gets ignored silently. if (Runtime.isNonFragile()) { if (!Args.hasFlag(options::OPT_fobjc_legacy_dispatch, options::OPT_fno_objc_legacy_dispatch, Runtime.isLegacyDispatchDefaultForArch(Arch))) { if (TC.UseObjCMixedDispatch()) CmdArgs.push_back("-fobjc-dispatch-method=mixed"); else CmdArgs.push_back("-fobjc-dispatch-method=non-legacy"); } } // When ObjectiveC legacy runtime is in effect on MacOSX, turn on the option // to do Array/Dictionary subscripting by default. if (Arch == llvm::Triple::x86 && T.isMacOSX() && !T.isMacOSXVersionLT(10, 7) && Runtime.getKind() == ObjCRuntime::FragileMacOSX && Runtime.isNeXTFamily()) CmdArgs.push_back("-fobjc-subscripting-legacy-runtime"); // Allow -fno-objc-arr to trump -fobjc-arr/-fobjc-arc. // NOTE: This logic is duplicated in ToolChains.cpp. if (isObjCAutoRefCount(Args)) { TC.CheckObjCARC(); CmdArgs.push_back("-fobjc-arc"); // FIXME: It seems like this entire block, and several around it should be // wrapped in isObjC, but for now we just use it here as this is where it // was being used previously. if (types::isCXX(Input.getType()) && types::isObjC(Input.getType())) { if (TC.GetCXXStdlibType(Args) == ToolChain::CST_Libcxx) CmdArgs.push_back("-fobjc-arc-cxxlib=libc++"); else CmdArgs.push_back("-fobjc-arc-cxxlib=libstdc++"); } // Allow the user to enable full exceptions code emission. // We default off for Objective-C, on for Objective-C++. if (Args.hasFlag(options::OPT_fobjc_arc_exceptions, options::OPT_fno_objc_arc_exceptions, /*default=*/types::isCXX(Input.getType()))) CmdArgs.push_back("-fobjc-arc-exceptions"); } // Silence warning for full exception code emission options when explicitly // set to use no ARC. if (Args.hasArg(options::OPT_fno_objc_arc)) { Args.ClaimAllArgs(options::OPT_fobjc_arc_exceptions); Args.ClaimAllArgs(options::OPT_fno_objc_arc_exceptions); } // -fobjc-infer-related-result-type is the default, except in the Objective-C // rewriter. if (InferCovariantReturns) CmdArgs.push_back("-fno-objc-infer-related-result-type"); // Pass down -fobjc-weak or -fno-objc-weak if present. if (types::isObjC(Input.getType())) { auto WeakArg = Args.getLastArg(options::OPT_fobjc_weak, options::OPT_fno_objc_weak); if (!WeakArg) { // nothing to do } else if (!Runtime.allowsWeak()) { if (WeakArg->getOption().matches(options::OPT_fobjc_weak)) D.Diag(diag::err_objc_weak_unsupported); } else { WeakArg->render(Args, CmdArgs); } } } static void RenderDiagnosticsOptions(const Driver &D, const ArgList &Args, ArgStringList &CmdArgs) { bool CaretDefault = true; bool ColumnDefault = true; if (const Arg *A = Args.getLastArg(options::OPT__SLASH_diagnostics_classic, options::OPT__SLASH_diagnostics_column, options::OPT__SLASH_diagnostics_caret)) { switch (A->getOption().getID()) { case options::OPT__SLASH_diagnostics_caret: CaretDefault = true; ColumnDefault = true; break; case options::OPT__SLASH_diagnostics_column: CaretDefault = false; ColumnDefault = true; break; case options::OPT__SLASH_diagnostics_classic: CaretDefault = false; ColumnDefault = false; break; } } // -fcaret-diagnostics is default. if (!Args.hasFlag(options::OPT_fcaret_diagnostics, options::OPT_fno_caret_diagnostics, CaretDefault)) CmdArgs.push_back("-fno-caret-diagnostics"); // -fdiagnostics-fixit-info is default, only pass non-default. if (!Args.hasFlag(options::OPT_fdiagnostics_fixit_info, options::OPT_fno_diagnostics_fixit_info)) CmdArgs.push_back("-fno-diagnostics-fixit-info"); // Enable -fdiagnostics-show-option by default. if (Args.hasFlag(options::OPT_fdiagnostics_show_option, options::OPT_fno_diagnostics_show_option)) CmdArgs.push_back("-fdiagnostics-show-option"); if (const Arg *A = Args.getLastArg(options::OPT_fdiagnostics_show_category_EQ)) { CmdArgs.push_back("-fdiagnostics-show-category"); CmdArgs.push_back(A->getValue()); } if (Args.hasFlag(options::OPT_fdiagnostics_show_hotness, options::OPT_fno_diagnostics_show_hotness, false)) CmdArgs.push_back("-fdiagnostics-show-hotness"); if (const Arg *A = Args.getLastArg(options::OPT_fdiagnostics_hotness_threshold_EQ)) { std::string Opt = std::string("-fdiagnostics-hotness-threshold=") + A->getValue(); CmdArgs.push_back(Args.MakeArgString(Opt)); } if (const Arg *A = Args.getLastArg(options::OPT_fdiagnostics_format_EQ)) { CmdArgs.push_back("-fdiagnostics-format"); CmdArgs.push_back(A->getValue()); } if (const Arg *A = Args.getLastArg( options::OPT_fdiagnostics_show_note_include_stack, options::OPT_fno_diagnostics_show_note_include_stack)) { const Option &O = A->getOption(); if (O.matches(options::OPT_fdiagnostics_show_note_include_stack)) CmdArgs.push_back("-fdiagnostics-show-note-include-stack"); else CmdArgs.push_back("-fno-diagnostics-show-note-include-stack"); } // Color diagnostics are parsed by the driver directly from argv and later // re-parsed to construct this job; claim any possible color diagnostic here // to avoid warn_drv_unused_argument and diagnose bad // OPT_fdiagnostics_color_EQ values. for (const Arg *A : Args) { const Option &O = A->getOption(); if (!O.matches(options::OPT_fcolor_diagnostics) && !O.matches(options::OPT_fdiagnostics_color) && !O.matches(options::OPT_fno_color_diagnostics) && !O.matches(options::OPT_fno_diagnostics_color) && !O.matches(options::OPT_fdiagnostics_color_EQ)) continue; if (O.matches(options::OPT_fdiagnostics_color_EQ)) { StringRef Value(A->getValue()); if (Value != "always" && Value != "never" && Value != "auto") D.Diag(diag::err_drv_clang_unsupported) << ("-fdiagnostics-color=" + Value).str(); } A->claim(); } if (D.getDiags().getDiagnosticOptions().ShowColors) CmdArgs.push_back("-fcolor-diagnostics"); if (Args.hasArg(options::OPT_fansi_escape_codes)) CmdArgs.push_back("-fansi-escape-codes"); if (!Args.hasFlag(options::OPT_fshow_source_location, options::OPT_fno_show_source_location)) CmdArgs.push_back("-fno-show-source-location"); if (Args.hasArg(options::OPT_fdiagnostics_absolute_paths)) CmdArgs.push_back("-fdiagnostics-absolute-paths"); if (!Args.hasFlag(options::OPT_fshow_column, options::OPT_fno_show_column, ColumnDefault)) CmdArgs.push_back("-fno-show-column"); if (!Args.hasFlag(options::OPT_fspell_checking, options::OPT_fno_spell_checking)) CmdArgs.push_back("-fno-spell-checking"); } static void RenderDebugOptions(const ToolChain &TC, const Driver &D, const llvm::Triple &T, const ArgList &Args, bool EmitCodeView, bool IsWindowsMSVC, ArgStringList &CmdArgs, codegenoptions::DebugInfoKind &DebugInfoKind, const Arg *&SplitDWARFArg) { if (Args.hasFlag(options::OPT_fdebug_info_for_profiling, options::OPT_fno_debug_info_for_profiling, false) && checkDebugInfoOption( Args.getLastArg(options::OPT_fdebug_info_for_profiling), Args, D, TC)) CmdArgs.push_back("-fdebug-info-for-profiling"); // The 'g' groups options involve a somewhat intricate sequence of decisions // about what to pass from the driver to the frontend, but by the time they // reach cc1 they've been factored into three well-defined orthogonal choices: // * what level of debug info to generate // * what dwarf version to write // * what debugger tuning to use // This avoids having to monkey around further in cc1 other than to disable // codeview if not running in a Windows environment. Perhaps even that // decision should be made in the driver as well though. unsigned DWARFVersion = 0; llvm::DebuggerKind DebuggerTuning = TC.getDefaultDebuggerTuning(); bool SplitDWARFInlining = Args.hasFlag(options::OPT_fsplit_dwarf_inlining, options::OPT_fno_split_dwarf_inlining, true); Args.ClaimAllArgs(options::OPT_g_Group); SplitDWARFArg = Args.getLastArg(options::OPT_gsplit_dwarf); if (SplitDWARFArg && !checkDebugInfoOption(SplitDWARFArg, Args, D, TC)) { SplitDWARFArg = nullptr; SplitDWARFInlining = false; } if (const Arg *A = Args.getLastArg(options::OPT_g_Group)) { if (checkDebugInfoOption(A, Args, D, TC)) { // If the last option explicitly specified a debug-info level, use it. if (A->getOption().matches(options::OPT_gN_Group)) { DebugInfoKind = DebugLevelToInfoKind(*A); // If you say "-gsplit-dwarf -gline-tables-only", -gsplit-dwarf loses. // But -gsplit-dwarf is not a g_group option, hence we have to check the // order explicitly. If -gsplit-dwarf wins, we fix DebugInfoKind later. // This gets a bit more complicated if you've disabled inline info in // the skeleton CUs (SplitDWARFInlining) - then there's value in // composing split-dwarf and line-tables-only, so let those compose // naturally in that case. And if you just turned off debug info, // (-gsplit-dwarf -g0) - do that. if (SplitDWARFArg) { if (A->getIndex() > SplitDWARFArg->getIndex()) { if (DebugInfoKind == codegenoptions::NoDebugInfo || (DebugInfoKind == codegenoptions::DebugLineTablesOnly && SplitDWARFInlining)) SplitDWARFArg = nullptr; } else if (SplitDWARFInlining) DebugInfoKind = codegenoptions::NoDebugInfo; } } else { // For any other 'g' option, use Limited. DebugInfoKind = codegenoptions::LimitedDebugInfo; } } else { DebugInfoKind = codegenoptions::LimitedDebugInfo; } } // If a debugger tuning argument appeared, remember it. if (const Arg *A = Args.getLastArg(options::OPT_gTune_Group, options::OPT_ggdbN_Group)) { if (checkDebugInfoOption(A, Args, D, TC)) { if (A->getOption().matches(options::OPT_glldb)) DebuggerTuning = llvm::DebuggerKind::LLDB; else if (A->getOption().matches(options::OPT_gsce)) DebuggerTuning = llvm::DebuggerKind::SCE; else DebuggerTuning = llvm::DebuggerKind::GDB; } } // If a -gdwarf argument appeared, remember it. if (const Arg *A = Args.getLastArg(options::OPT_gdwarf_2, options::OPT_gdwarf_3, options::OPT_gdwarf_4, options::OPT_gdwarf_5)) if (checkDebugInfoOption(A, Args, D, TC)) DWARFVersion = DwarfVersionNum(A->getSpelling()); // Forward -gcodeview. EmitCodeView might have been set by CL-compatibility // argument parsing. if (EmitCodeView) { if (const Arg *A = Args.getLastArg(options::OPT_gcodeview)) { EmitCodeView = checkDebugInfoOption(A, Args, D, TC); if (EmitCodeView) { // DWARFVersion remains at 0 if no explicit choice was made. CmdArgs.push_back("-gcodeview"); } } } if (!EmitCodeView && DWARFVersion == 0 && DebugInfoKind != codegenoptions::NoDebugInfo) DWARFVersion = TC.GetDefaultDwarfVersion(); // We ignore flag -gstrict-dwarf for now. // And we handle flag -grecord-gcc-switches later with DWARFDebugFlags. Args.ClaimAllArgs(options::OPT_g_flags_Group); // Column info is included by default for everything except SCE and // CodeView. Clang doesn't track end columns, just starting columns, which, // in theory, is fine for CodeView (and PDB). In practice, however, the // Microsoft debuggers don't handle missing end columns well, so it's better // not to include any column info. if (const Arg *A = Args.getLastArg(options::OPT_gcolumn_info)) (void)checkDebugInfoOption(A, Args, D, TC); if (Args.hasFlag(options::OPT_gcolumn_info, options::OPT_gno_column_info, /*Default=*/!EmitCodeView && DebuggerTuning != llvm::DebuggerKind::SCE)) CmdArgs.push_back("-dwarf-column-info"); // FIXME: Move backend command line options to the module. // If -gline-tables-only is the last option it wins. if (const Arg *A = Args.getLastArg(options::OPT_gmodules)) if (checkDebugInfoOption(A, Args, D, TC)) { if (DebugInfoKind != codegenoptions::DebugLineTablesOnly) { DebugInfoKind = codegenoptions::LimitedDebugInfo; CmdArgs.push_back("-dwarf-ext-refs"); CmdArgs.push_back("-fmodule-format=obj"); } } // -gsplit-dwarf should turn on -g and enable the backend dwarf // splitting and extraction. // FIXME: Currently only works on Linux. if (T.isOSLinux()) { if (!SplitDWARFInlining) CmdArgs.push_back("-fno-split-dwarf-inlining"); if (SplitDWARFArg) { if (DebugInfoKind == codegenoptions::NoDebugInfo) DebugInfoKind = codegenoptions::LimitedDebugInfo; CmdArgs.push_back("-enable-split-dwarf"); } } // After we've dealt with all combinations of things that could // make DebugInfoKind be other than None or DebugLineTablesOnly, // figure out if we need to "upgrade" it to standalone debug info. // We parse these two '-f' options whether or not they will be used, // to claim them even if you wrote "-fstandalone-debug -gline-tables-only" bool NeedFullDebug = Args.hasFlag(options::OPT_fstandalone_debug, options::OPT_fno_standalone_debug, TC.GetDefaultStandaloneDebug()); if (const Arg *A = Args.getLastArg(options::OPT_fstandalone_debug)) (void)checkDebugInfoOption(A, Args, D, TC); if (DebugInfoKind == codegenoptions::LimitedDebugInfo && NeedFullDebug) DebugInfoKind = codegenoptions::FullDebugInfo; if (Args.hasFlag(options::OPT_gembed_source, options::OPT_gno_embed_source, false)) { // Source embedding is a vendor extension to DWARF v5. By now we have // checked if a DWARF version was stated explicitly, and have otherwise // fallen back to the target default, so if this is still not at least 5 // we emit an error. const Arg *A = Args.getLastArg(options::OPT_gembed_source); if (DWARFVersion < 5) D.Diag(diag::err_drv_argument_only_allowed_with) << A->getAsString(Args) << "-gdwarf-5"; else if (checkDebugInfoOption(A, Args, D, TC)) CmdArgs.push_back("-gembed-source"); } RenderDebugEnablingArgs(Args, CmdArgs, DebugInfoKind, DWARFVersion, DebuggerTuning); // -fdebug-macro turns on macro debug info generation. if (Args.hasFlag(options::OPT_fdebug_macro, options::OPT_fno_debug_macro, false)) if (checkDebugInfoOption(Args.getLastArg(options::OPT_fdebug_macro), Args, D, TC)) CmdArgs.push_back("-debug-info-macro"); // -ggnu-pubnames turns on gnu style pubnames in the backend. if (Args.hasFlag(options::OPT_ggnu_pubnames, options::OPT_gno_gnu_pubnames, false)) if (checkDebugInfoOption(Args.getLastArg(options::OPT_ggnu_pubnames), Args, D, TC)) CmdArgs.push_back("-ggnu-pubnames"); // -gdwarf-aranges turns on the emission of the aranges section in the // backend. // Always enabled for SCE tuning. bool NeedAranges = DebuggerTuning == llvm::DebuggerKind::SCE; if (const Arg *A = Args.getLastArg(options::OPT_gdwarf_aranges)) NeedAranges = checkDebugInfoOption(A, Args, D, TC) || NeedAranges; if (NeedAranges) { CmdArgs.push_back("-mllvm"); CmdArgs.push_back("-generate-arange-section"); } if (Args.hasFlag(options::OPT_fdebug_types_section, options::OPT_fno_debug_types_section, false)) { if (!T.isOSBinFormatELF()) { D.Diag(diag::err_drv_unsupported_opt_for_target) << Args.getLastArg(options::OPT_fdebug_types_section) ->getAsString(Args) << T.getTriple(); } else if (checkDebugInfoOption( Args.getLastArg(options::OPT_fdebug_types_section), Args, D, TC)) { CmdArgs.push_back("-mllvm"); CmdArgs.push_back("-generate-type-units"); } } // Decide how to render forward declarations of template instantiations. // SCE wants full descriptions, others just get them in the name. if (DebuggerTuning == llvm::DebuggerKind::SCE) CmdArgs.push_back("-debug-forward-template-params"); // Do we need to explicitly import anonymous namespaces into the parent // scope? if (DebuggerTuning == llvm::DebuggerKind::SCE) CmdArgs.push_back("-dwarf-explicit-import"); RenderDebugInfoCompressionArgs(Args, CmdArgs, D, TC); } void Clang::ConstructJob(Compilation &C, const JobAction &JA, const InputInfo &Output, const InputInfoList &Inputs, const ArgList &Args, const char *LinkingOutput) const { const llvm::Triple &RawTriple = getToolChain().getTriple(); const llvm::Triple &Triple = getToolChain().getEffectiveTriple(); const std::string &TripleStr = Triple.getTriple(); bool KernelOrKext = Args.hasArg(options::OPT_mkernel, options::OPT_fapple_kext); const Driver &D = getToolChain().getDriver(); ArgStringList CmdArgs; // Check number of inputs for sanity. We need at least one input. assert(Inputs.size() >= 1 && "Must have at least one input."); const InputInfo &Input = Inputs[0]; // CUDA/HIP compilation may have multiple inputs (source file + results of // device-side compilations). OpenMP device jobs also take the host IR as a // second input. All other jobs are expected to have exactly one // input. bool IsCuda = JA.isOffloading(Action::OFK_Cuda); bool IsHIP = JA.isOffloading(Action::OFK_HIP); bool IsOpenMPDevice = JA.isDeviceOffloading(Action::OFK_OpenMP); assert((IsCuda || IsHIP || (IsOpenMPDevice && Inputs.size() == 2) || Inputs.size() == 1) && "Unable to handle multiple inputs."); const llvm::Triple *AuxTriple = IsCuda ? getToolChain().getAuxTriple() : nullptr; bool IsWindowsGNU = RawTriple.isWindowsGNUEnvironment(); bool IsWindowsCygnus = RawTriple.isWindowsCygwinEnvironment(); bool IsWindowsMSVC = RawTriple.isWindowsMSVCEnvironment(); bool IsIAMCU = RawTriple.isOSIAMCU(); // Adjust IsWindowsXYZ for CUDA/HIP compilations. Even when compiling in // device mode (i.e., getToolchain().getTriple() is NVPTX/AMDGCN, not // Windows), we need to pass Windows-specific flags to cc1. if (IsCuda || IsHIP) { IsWindowsMSVC |= AuxTriple && AuxTriple->isWindowsMSVCEnvironment(); IsWindowsGNU |= AuxTriple && AuxTriple->isWindowsGNUEnvironment(); IsWindowsCygnus |= AuxTriple && AuxTriple->isWindowsCygwinEnvironment(); } // C++ is not supported for IAMCU. if (IsIAMCU && types::isCXX(Input.getType())) D.Diag(diag::err_drv_clang_unsupported) << "C++ for IAMCU"; // Invoke ourselves in -cc1 mode. // // FIXME: Implement custom jobs for internal actions. CmdArgs.push_back("-cc1"); // Add the "effective" target triple. CmdArgs.push_back("-triple"); CmdArgs.push_back(Args.MakeArgString(TripleStr)); if (const Arg *MJ = Args.getLastArg(options::OPT_MJ)) { DumpCompilationDatabase(C, MJ->getValue(), TripleStr, Output, Input, Args); Args.ClaimAllArgs(options::OPT_MJ); } if (IsCuda || IsHIP) { // We have to pass the triple of the host if compiling for a CUDA/HIP device // and vice-versa. std::string NormalizedTriple; if (JA.isDeviceOffloading(Action::OFK_Cuda) || JA.isDeviceOffloading(Action::OFK_HIP)) NormalizedTriple = C.getSingleOffloadToolChain() ->getTriple() .normalize(); else NormalizedTriple = (IsCuda ? C.getSingleOffloadToolChain() : C.getSingleOffloadToolChain()) ->getTriple() .normalize(); CmdArgs.push_back("-aux-triple"); CmdArgs.push_back(Args.MakeArgString(NormalizedTriple)); } if (IsOpenMPDevice) { // We have to pass the triple of the host if compiling for an OpenMP device. std::string NormalizedTriple = C.getSingleOffloadToolChain() ->getTriple() .normalize(); CmdArgs.push_back("-aux-triple"); CmdArgs.push_back(Args.MakeArgString(NormalizedTriple)); } if (Triple.isOSWindows() && (Triple.getArch() == llvm::Triple::arm || Triple.getArch() == llvm::Triple::thumb)) { unsigned Offset = Triple.getArch() == llvm::Triple::arm ? 4 : 6; unsigned Version; Triple.getArchName().substr(Offset).getAsInteger(10, Version); if (Version < 7) D.Diag(diag::err_target_unsupported_arch) << Triple.getArchName() << TripleStr; } // Push all default warning arguments that are specific to // the given target. These come before user provided warning options // are provided. getToolChain().addClangWarningOptions(CmdArgs); // Select the appropriate action. RewriteKind rewriteKind = RK_None; if (isa(JA)) { assert(JA.getType() == types::TY_Plist && "Invalid output type."); CmdArgs.push_back("-analyze"); } else if (isa(JA)) { CmdArgs.push_back("-migrate"); } else if (isa(JA)) { if (Output.getType() == types::TY_Dependencies) CmdArgs.push_back("-Eonly"); else { CmdArgs.push_back("-E"); if (Args.hasArg(options::OPT_rewrite_objc) && !Args.hasArg(options::OPT_g_Group)) CmdArgs.push_back("-P"); } } else if (isa(JA)) { CmdArgs.push_back("-emit-obj"); CollectArgsForIntegratedAssembler(C, Args, CmdArgs, D); // Also ignore explicit -force_cpusubtype_ALL option. (void)Args.hasArg(options::OPT_force__cpusubtype__ALL); } else if (isa(JA)) { // Use PCH if the user requested it. bool UsePCH = D.CCCUsePCH; if (JA.getType() == types::TY_Nothing) CmdArgs.push_back("-fsyntax-only"); else if (JA.getType() == types::TY_ModuleFile) CmdArgs.push_back("-emit-module-interface"); else if (UsePCH) CmdArgs.push_back("-emit-pch"); else CmdArgs.push_back("-emit-pth"); } else if (isa(JA)) { CmdArgs.push_back("-verify-pch"); } else { assert((isa(JA) || isa(JA)) && "Invalid action for clang tool."); if (JA.getType() == types::TY_Nothing) { CmdArgs.push_back("-fsyntax-only"); } else if (JA.getType() == types::TY_LLVM_IR || JA.getType() == types::TY_LTO_IR) { CmdArgs.push_back("-emit-llvm"); } else if (JA.getType() == types::TY_LLVM_BC || JA.getType() == types::TY_LTO_BC) { CmdArgs.push_back("-emit-llvm-bc"); } else if (JA.getType() == types::TY_PP_Asm) { CmdArgs.push_back("-S"); } else if (JA.getType() == types::TY_AST) { CmdArgs.push_back("-emit-pch"); } else if (JA.getType() == types::TY_ModuleFile) { CmdArgs.push_back("-module-file-info"); } else if (JA.getType() == types::TY_RewrittenObjC) { CmdArgs.push_back("-rewrite-objc"); rewriteKind = RK_NonFragile; } else if (JA.getType() == types::TY_RewrittenLegacyObjC) { CmdArgs.push_back("-rewrite-objc"); rewriteKind = RK_Fragile; } else { assert(JA.getType() == types::TY_PP_Asm && "Unexpected output type!"); } // Preserve use-list order by default when emitting bitcode, so that // loading the bitcode up in 'opt' or 'llc' and running passes gives the // same result as running passes here. For LTO, we don't need to preserve // the use-list order, since serialization to bitcode is part of the flow. if (JA.getType() == types::TY_LLVM_BC) CmdArgs.push_back("-emit-llvm-uselists"); // Device-side jobs do not support LTO. bool isDeviceOffloadAction = !(JA.isDeviceOffloading(Action::OFK_None) || JA.isDeviceOffloading(Action::OFK_Host)); if (D.isUsingLTO() && !isDeviceOffloadAction) { Args.AddLastArg(CmdArgs, options::OPT_flto, options::OPT_flto_EQ); // The Darwin and PS4 linkers currently use the legacy LTO API, which // does not support LTO unit features (CFI, whole program vtable opt) // under ThinLTO. if (!(RawTriple.isOSDarwin() || RawTriple.isPS4()) || D.getLTOMode() == LTOK_Full) CmdArgs.push_back("-flto-unit"); } } if (const Arg *A = Args.getLastArg(options::OPT_fthinlto_index_EQ)) { if (!types::isLLVMIR(Input.getType())) D.Diag(diag::err_drv_argument_only_allowed_with) << A->getAsString(Args) << "-x ir"; Args.AddLastArg(CmdArgs, options::OPT_fthinlto_index_EQ); } if (Args.getLastArg(options::OPT_save_temps_EQ)) Args.AddLastArg(CmdArgs, options::OPT_save_temps_EQ); // Embed-bitcode option. if (C.getDriver().embedBitcodeInObject() && !C.getDriver().isUsingLTO() && (isa(JA) || isa(JA))) { // Add flags implied by -fembed-bitcode. Args.AddLastArg(CmdArgs, options::OPT_fembed_bitcode_EQ); // Disable all llvm IR level optimizations. CmdArgs.push_back("-disable-llvm-passes"); } if (C.getDriver().embedBitcodeMarkerOnly() && !C.getDriver().isUsingLTO()) CmdArgs.push_back("-fembed-bitcode=marker"); // We normally speed up the clang process a bit by skipping destructors at // exit, but when we're generating diagnostics we can rely on some of the // cleanup. if (!C.isForDiagnostics()) CmdArgs.push_back("-disable-free"); #ifdef NDEBUG const bool IsAssertBuild = false; #else const bool IsAssertBuild = true; #endif // Disable the verification pass in -asserts builds. if (!IsAssertBuild) CmdArgs.push_back("-disable-llvm-verifier"); // Discard value names in assert builds unless otherwise specified. if (Args.hasFlag(options::OPT_fdiscard_value_names, options::OPT_fno_discard_value_names, !IsAssertBuild)) CmdArgs.push_back("-discard-value-names"); // Set the main file name, so that debug info works even with // -save-temps. CmdArgs.push_back("-main-file-name"); CmdArgs.push_back(getBaseInputName(Args, Input)); // Some flags which affect the language (via preprocessor // defines). if (Args.hasArg(options::OPT_static)) CmdArgs.push_back("-static-define"); if (isa(JA)) RenderAnalyzerOptions(Args, CmdArgs, Triple, Input); CheckCodeGenerationOptions(D, Args); unsigned FunctionAlignment = ParseFunctionAlignment(getToolChain(), Args); assert(FunctionAlignment <= 31 && "function alignment will be truncated!"); if (FunctionAlignment) { CmdArgs.push_back("-function-alignment"); CmdArgs.push_back(Args.MakeArgString(std::to_string(FunctionAlignment))); } llvm::Reloc::Model RelocationModel; unsigned PICLevel; bool IsPIE; std::tie(RelocationModel, PICLevel, IsPIE) = ParsePICArgs(getToolChain(), Args); const char *RMName = RelocationModelName(RelocationModel); if ((RelocationModel == llvm::Reloc::ROPI || RelocationModel == llvm::Reloc::ROPI_RWPI) && types::isCXX(Input.getType()) && !Args.hasArg(options::OPT_fallow_unsupported)) D.Diag(diag::err_drv_ropi_incompatible_with_cxx); if (RMName) { CmdArgs.push_back("-mrelocation-model"); CmdArgs.push_back(RMName); } if (PICLevel > 0) { CmdArgs.push_back("-pic-level"); CmdArgs.push_back(PICLevel == 1 ? "1" : "2"); if (IsPIE) CmdArgs.push_back("-pic-is-pie"); } if (Arg *A = Args.getLastArg(options::OPT_meabi)) { CmdArgs.push_back("-meabi"); CmdArgs.push_back(A->getValue()); } CmdArgs.push_back("-mthread-model"); if (Arg *A = Args.getLastArg(options::OPT_mthread_model)) { if (!getToolChain().isThreadModelSupported(A->getValue())) D.Diag(diag::err_drv_invalid_thread_model_for_target) << A->getValue() << A->getAsString(Args); CmdArgs.push_back(A->getValue()); } else CmdArgs.push_back(Args.MakeArgString(getToolChain().getThreadModel())); Args.AddLastArg(CmdArgs, options::OPT_fveclib); if (Args.hasFlag(options::OPT_fmerge_all_constants, options::OPT_fno_merge_all_constants, false)) CmdArgs.push_back("-fmerge-all-constants"); if (Args.hasFlag(options::OPT_fno_delete_null_pointer_checks, options::OPT_fdelete_null_pointer_checks, false)) CmdArgs.push_back("-fno-delete-null-pointer-checks"); // LLVM Code Generator Options. if (Args.hasArg(options::OPT_frewrite_map_file) || Args.hasArg(options::OPT_frewrite_map_file_EQ)) { for (const Arg *A : Args.filtered(options::OPT_frewrite_map_file, options::OPT_frewrite_map_file_EQ)) { StringRef Map = A->getValue(); if (!llvm::sys::fs::exists(Map)) { D.Diag(diag::err_drv_no_such_file) << Map; } else { CmdArgs.push_back("-frewrite-map-file"); CmdArgs.push_back(A->getValue()); A->claim(); } } } if (Arg *A = Args.getLastArg(options::OPT_Wframe_larger_than_EQ)) { StringRef v = A->getValue(); CmdArgs.push_back("-mllvm"); CmdArgs.push_back(Args.MakeArgString("-warn-stack-size=" + v)); A->claim(); } if (!Args.hasFlag(options::OPT_fjump_tables, options::OPT_fno_jump_tables, true)) CmdArgs.push_back("-fno-jump-tables"); if (Args.hasFlag(options::OPT_fprofile_sample_accurate, options::OPT_fno_profile_sample_accurate, false)) CmdArgs.push_back("-fprofile-sample-accurate"); if (!Args.hasFlag(options::OPT_fpreserve_as_comments, options::OPT_fno_preserve_as_comments, true)) CmdArgs.push_back("-fno-preserve-as-comments"); if (Arg *A = Args.getLastArg(options::OPT_mregparm_EQ)) { CmdArgs.push_back("-mregparm"); CmdArgs.push_back(A->getValue()); } if (Arg *A = Args.getLastArg(options::OPT_fpcc_struct_return, options::OPT_freg_struct_return)) { if (getToolChain().getArch() != llvm::Triple::x86) { D.Diag(diag::err_drv_unsupported_opt_for_target) << A->getSpelling() << RawTriple.str(); } else if (A->getOption().matches(options::OPT_fpcc_struct_return)) { CmdArgs.push_back("-fpcc-struct-return"); } else { assert(A->getOption().matches(options::OPT_freg_struct_return)); CmdArgs.push_back("-freg-struct-return"); } } if (Args.hasFlag(options::OPT_mrtd, options::OPT_mno_rtd, false)) CmdArgs.push_back("-fdefault-calling-conv=stdcall"); if (shouldUseFramePointer(Args, RawTriple)) CmdArgs.push_back("-mdisable-fp-elim"); if (!Args.hasFlag(options::OPT_fzero_initialized_in_bss, options::OPT_fno_zero_initialized_in_bss)) CmdArgs.push_back("-mno-zero-initialized-in-bss"); bool OFastEnabled = isOptimizationLevelFast(Args); // If -Ofast is the optimization level, then -fstrict-aliasing should be // enabled. This alias option is being used to simplify the hasFlag logic. OptSpecifier StrictAliasingAliasOption = OFastEnabled ? options::OPT_Ofast : options::OPT_fstrict_aliasing; // We turn strict aliasing off by default if we're in CL mode, since MSVC // doesn't do any TBAA. bool TBAAOnByDefault = !D.IsCLMode(); if (!Args.hasFlag(options::OPT_fstrict_aliasing, StrictAliasingAliasOption, options::OPT_fno_strict_aliasing, TBAAOnByDefault)) CmdArgs.push_back("-relaxed-aliasing"); if (!Args.hasFlag(options::OPT_fstruct_path_tbaa, options::OPT_fno_struct_path_tbaa)) CmdArgs.push_back("-no-struct-path-tbaa"); if (Args.hasFlag(options::OPT_fstrict_enums, options::OPT_fno_strict_enums, false)) CmdArgs.push_back("-fstrict-enums"); if (!Args.hasFlag(options::OPT_fstrict_return, options::OPT_fno_strict_return, true)) CmdArgs.push_back("-fno-strict-return"); if (Args.hasFlag(options::OPT_fallow_editor_placeholders, options::OPT_fno_allow_editor_placeholders, false)) CmdArgs.push_back("-fallow-editor-placeholders"); if (Args.hasFlag(options::OPT_fstrict_vtable_pointers, options::OPT_fno_strict_vtable_pointers, false)) CmdArgs.push_back("-fstrict-vtable-pointers"); if (Args.hasFlag(options::OPT_fforce_emit_vtables, options::OPT_fno_force_emit_vtables, false)) CmdArgs.push_back("-fforce-emit-vtables"); if (!Args.hasFlag(options::OPT_foptimize_sibling_calls, options::OPT_fno_optimize_sibling_calls)) CmdArgs.push_back("-mdisable-tail-calls"); if (Args.hasFlag(options::OPT_fno_escaping_block_tail_calls, options::OPT_fescaping_block_tail_calls, false)) CmdArgs.push_back("-fno-escaping-block-tail-calls"); Args.AddLastArg(CmdArgs, options::OPT_ffine_grained_bitfield_accesses, options::OPT_fno_fine_grained_bitfield_accesses); // Handle segmented stacks. if (Args.hasArg(options::OPT_fsplit_stack)) CmdArgs.push_back("-split-stacks"); RenderFloatingPointOptions(getToolChain(), D, OFastEnabled, Args, CmdArgs); // Decide whether to use verbose asm. Verbose assembly is the default on // toolchains which have the integrated assembler on by default. bool IsIntegratedAssemblerDefault = getToolChain().IsIntegratedAssemblerDefault(); if (Args.hasFlag(options::OPT_fverbose_asm, options::OPT_fno_verbose_asm, IsIntegratedAssemblerDefault) || Args.hasArg(options::OPT_dA)) CmdArgs.push_back("-masm-verbose"); if (!getToolChain().useIntegratedAs()) CmdArgs.push_back("-no-integrated-as"); if (Args.hasArg(options::OPT_fdebug_pass_structure)) { CmdArgs.push_back("-mdebug-pass"); CmdArgs.push_back("Structure"); } if (Args.hasArg(options::OPT_fdebug_pass_arguments)) { CmdArgs.push_back("-mdebug-pass"); CmdArgs.push_back("Arguments"); } // Enable -mconstructor-aliases except on darwin, where we have to work around // a linker bug (see ), and CUDA device code, where // aliases aren't supported. if (!RawTriple.isOSDarwin() && !RawTriple.isNVPTX()) CmdArgs.push_back("-mconstructor-aliases"); // Darwin's kernel doesn't support guard variables; just die if we // try to use them. if (KernelOrKext && RawTriple.isOSDarwin()) CmdArgs.push_back("-fforbid-guard-variables"); if (Args.hasFlag(options::OPT_mms_bitfields, options::OPT_mno_ms_bitfields, false)) { CmdArgs.push_back("-mms-bitfields"); } if (Args.hasFlag(options::OPT_mpie_copy_relocations, options::OPT_mno_pie_copy_relocations, false)) { CmdArgs.push_back("-mpie-copy-relocations"); } if (Args.hasFlag(options::OPT_fno_plt, options::OPT_fplt, false)) { CmdArgs.push_back("-fno-plt"); } // -fhosted is default. // TODO: Audit uses of KernelOrKext and see where it'd be more appropriate to // use Freestanding. bool Freestanding = Args.hasFlag(options::OPT_ffreestanding, options::OPT_fhosted, false) || KernelOrKext; if (Freestanding) CmdArgs.push_back("-ffreestanding"); // This is a coarse approximation of what llvm-gcc actually does, both // -fasynchronous-unwind-tables and -fnon-call-exceptions interact in more // complicated ways. bool AsynchronousUnwindTables = Args.hasFlag(options::OPT_fasynchronous_unwind_tables, options::OPT_fno_asynchronous_unwind_tables, (getToolChain().IsUnwindTablesDefault(Args) || getToolChain().getSanitizerArgs().needsUnwindTables()) && !Freestanding); if (Args.hasFlag(options::OPT_funwind_tables, options::OPT_fno_unwind_tables, AsynchronousUnwindTables)) CmdArgs.push_back("-munwind-tables"); getToolChain().addClangTargetOptions(Args, CmdArgs, JA.getOffloadingDeviceKind()); if (Arg *A = Args.getLastArg(options::OPT_flimited_precision_EQ)) { CmdArgs.push_back("-mlimit-float-precision"); CmdArgs.push_back(A->getValue()); } // FIXME: Handle -mtune=. (void)Args.hasArg(options::OPT_mtune_EQ); if (Arg *A = Args.getLastArg(options::OPT_mcmodel_EQ)) { CmdArgs.push_back("-mcode-model"); CmdArgs.push_back(A->getValue()); } // Add the target cpu std::string CPU = getCPUName(Args, Triple, /*FromAs*/ false); if (!CPU.empty()) { CmdArgs.push_back("-target-cpu"); CmdArgs.push_back(Args.MakeArgString(CPU)); } RenderTargetOptions(Triple, Args, KernelOrKext, CmdArgs); // These two are potentially updated by AddClangCLArgs. codegenoptions::DebugInfoKind DebugInfoKind = codegenoptions::NoDebugInfo; bool EmitCodeView = false; // Add clang-cl arguments. types::ID InputType = Input.getType(); if (D.IsCLMode()) AddClangCLArgs(Args, InputType, CmdArgs, &DebugInfoKind, &EmitCodeView); else EmitCodeView = Args.hasArg(options::OPT_gcodeview); const Arg *SplitDWARFArg = nullptr; RenderDebugOptions(getToolChain(), D, RawTriple, Args, EmitCodeView, IsWindowsMSVC, CmdArgs, DebugInfoKind, SplitDWARFArg); // Add the split debug info name to the command lines here so we // can propagate it to the backend. bool SplitDWARF = SplitDWARFArg && RawTriple.isOSLinux() && (isa(JA) || isa(JA) || isa(JA)); const char *SplitDWARFOut; if (SplitDWARF) { CmdArgs.push_back("-split-dwarf-file"); SplitDWARFOut = SplitDebugName(Args, Input); CmdArgs.push_back(SplitDWARFOut); } // Pass the linker version in use. if (Arg *A = Args.getLastArg(options::OPT_mlinker_version_EQ)) { CmdArgs.push_back("-target-linker-version"); CmdArgs.push_back(A->getValue()); } if (!shouldUseLeafFramePointer(Args, RawTriple)) CmdArgs.push_back("-momit-leaf-frame-pointer"); // Explicitly error on some things we know we don't support and can't just // ignore. if (!Args.hasArg(options::OPT_fallow_unsupported)) { Arg *Unsupported; if (types::isCXX(InputType) && RawTriple.isOSDarwin() && getToolChain().getArch() == llvm::Triple::x86) { if ((Unsupported = Args.getLastArg(options::OPT_fapple_kext)) || (Unsupported = Args.getLastArg(options::OPT_mkernel))) D.Diag(diag::err_drv_clang_unsupported_opt_cxx_darwin_i386) << Unsupported->getOption().getName(); } // The faltivec option has been superseded by the maltivec option. if ((Unsupported = Args.getLastArg(options::OPT_faltivec))) D.Diag(diag::err_drv_clang_unsupported_opt_faltivec) << Unsupported->getOption().getName() << "please use -maltivec and include altivec.h explicitly"; if ((Unsupported = Args.getLastArg(options::OPT_fno_altivec))) D.Diag(diag::err_drv_clang_unsupported_opt_faltivec) << Unsupported->getOption().getName() << "please use -mno-altivec"; } Args.AddAllArgs(CmdArgs, options::OPT_v); Args.AddLastArg(CmdArgs, options::OPT_H); if (D.CCPrintHeaders && !D.CCGenDiagnostics) { CmdArgs.push_back("-header-include-file"); CmdArgs.push_back(D.CCPrintHeadersFilename ? D.CCPrintHeadersFilename : "-"); } Args.AddLastArg(CmdArgs, options::OPT_P); Args.AddLastArg(CmdArgs, options::OPT_print_ivar_layout); if (D.CCLogDiagnostics && !D.CCGenDiagnostics) { CmdArgs.push_back("-diagnostic-log-file"); CmdArgs.push_back(D.CCLogDiagnosticsFilename ? D.CCLogDiagnosticsFilename : "-"); } bool UseSeparateSections = isUseSeparateSections(Triple); if (Args.hasFlag(options::OPT_ffunction_sections, options::OPT_fno_function_sections, UseSeparateSections)) { CmdArgs.push_back("-ffunction-sections"); } if (Args.hasFlag(options::OPT_fdata_sections, options::OPT_fno_data_sections, UseSeparateSections)) { CmdArgs.push_back("-fdata-sections"); } if (!Args.hasFlag(options::OPT_funique_section_names, options::OPT_fno_unique_section_names, true)) CmdArgs.push_back("-fno-unique-section-names"); if (auto *A = Args.getLastArg( options::OPT_finstrument_functions, options::OPT_finstrument_functions_after_inlining, options::OPT_finstrument_function_entry_bare)) A->render(Args, CmdArgs); // NVPTX doesn't support PGO or coverage. There's no runtime support for // sampling, overhead of call arc collection is way too high and there's no // way to collect the output. if (!Triple.isNVPTX()) addPGOAndCoverageFlags(C, D, Output, Args, CmdArgs); if (auto *ABICompatArg = Args.getLastArg(options::OPT_fclang_abi_compat_EQ)) ABICompatArg->render(Args, CmdArgs); // Add runtime flag for PS4 when PGO, coverage, or sanitizers are enabled. if (RawTriple.isPS4CPU()) { PS4cpu::addProfileRTArgs(getToolChain(), Args, CmdArgs); PS4cpu::addSanitizerArgs(getToolChain(), CmdArgs); } // Pass options for controlling the default header search paths. if (Args.hasArg(options::OPT_nostdinc)) { CmdArgs.push_back("-nostdsysteminc"); CmdArgs.push_back("-nobuiltininc"); } else { if (Args.hasArg(options::OPT_nostdlibinc)) CmdArgs.push_back("-nostdsysteminc"); Args.AddLastArg(CmdArgs, options::OPT_nostdincxx); Args.AddLastArg(CmdArgs, options::OPT_nobuiltininc); } // Pass the path to compiler resource files. CmdArgs.push_back("-resource-dir"); CmdArgs.push_back(D.ResourceDir.c_str()); Args.AddLastArg(CmdArgs, options::OPT_working_directory); RenderARCMigrateToolOptions(D, Args, CmdArgs); // Add preprocessing options like -I, -D, etc. if we are using the // preprocessor. // // FIXME: Support -fpreprocessed if (types::getPreprocessedType(InputType) != types::TY_INVALID) AddPreprocessingOptions(C, JA, D, Args, CmdArgs, Output, Inputs); // Don't warn about "clang -c -DPIC -fPIC test.i" because libtool.m4 assumes // that "The compiler can only warn and ignore the option if not recognized". // When building with ccache, it will pass -D options to clang even on // preprocessed inputs and configure concludes that -fPIC is not supported. Args.ClaimAllArgs(options::OPT_D); // Manually translate -O4 to -O3; let clang reject others. if (Arg *A = Args.getLastArg(options::OPT_O_Group)) { if (A->getOption().matches(options::OPT_O4)) { CmdArgs.push_back("-O3"); D.Diag(diag::warn_O4_is_O3); } else { A->render(Args, CmdArgs); } } // Warn about ignored options to clang. for (const Arg *A : Args.filtered(options::OPT_clang_ignored_gcc_optimization_f_Group)) { D.Diag(diag::warn_ignored_gcc_optimization) << A->getAsString(Args); A->claim(); } for (const Arg *A : Args.filtered(options::OPT_clang_ignored_legacy_options_Group)) { D.Diag(diag::warn_ignored_clang_option) << A->getAsString(Args); A->claim(); } claimNoWarnArgs(Args); Args.AddAllArgs(CmdArgs, options::OPT_R_Group); Args.AddAllArgs(CmdArgs, options::OPT_W_Group); if (Args.hasFlag(options::OPT_pedantic, options::OPT_no_pedantic, false)) CmdArgs.push_back("-pedantic"); Args.AddLastArg(CmdArgs, options::OPT_pedantic_errors); Args.AddLastArg(CmdArgs, options::OPT_w); // Fixed point flags if (Args.hasFlag(options::OPT_ffixed_point, options::OPT_fno_fixed_point, /*Default=*/false)) Args.AddLastArg(CmdArgs, options::OPT_ffixed_point); // Handle -{std, ansi, trigraphs} -- take the last of -{std, ansi} // (-ansi is equivalent to -std=c89 or -std=c++98). // // If a std is supplied, only add -trigraphs if it follows the // option. bool ImplyVCPPCXXVer = false; if (Arg *Std = Args.getLastArg(options::OPT_std_EQ, options::OPT_ansi)) { if (Std->getOption().matches(options::OPT_ansi)) if (types::isCXX(InputType)) CmdArgs.push_back("-std=c++98"); else CmdArgs.push_back("-std=c89"); else Std->render(Args, CmdArgs); // If -f(no-)trigraphs appears after the language standard flag, honor it. if (Arg *A = Args.getLastArg(options::OPT_std_EQ, options::OPT_ansi, options::OPT_ftrigraphs, options::OPT_fno_trigraphs)) if (A != Std) A->render(Args, CmdArgs); } else { // Honor -std-default. // // FIXME: Clang doesn't correctly handle -std= when the input language // doesn't match. For the time being just ignore this for C++ inputs; // eventually we want to do all the standard defaulting here instead of // splitting it between the driver and clang -cc1. if (!types::isCXX(InputType)) Args.AddAllArgsTranslated(CmdArgs, options::OPT_std_default_EQ, "-std=", /*Joined=*/true); else if (IsWindowsMSVC) ImplyVCPPCXXVer = true; Args.AddLastArg(CmdArgs, options::OPT_ftrigraphs, options::OPT_fno_trigraphs); } // GCC's behavior for -Wwrite-strings is a bit strange: // * In C, this "warning flag" changes the types of string literals from // 'char[N]' to 'const char[N]', and thus triggers an unrelated warning // for the discarded qualifier. // * In C++, this is just a normal warning flag. // // Implementing this warning correctly in C is hard, so we follow GCC's // behavior for now. FIXME: Directly diagnose uses of a string literal as // a non-const char* in C, rather than using this crude hack. if (!types::isCXX(InputType)) { // FIXME: This should behave just like a warning flag, and thus should also // respect -Weverything, -Wno-everything, -Werror=write-strings, and so on. Arg *WriteStrings = Args.getLastArg(options::OPT_Wwrite_strings, options::OPT_Wno_write_strings, options::OPT_w); if (WriteStrings && WriteStrings->getOption().matches(options::OPT_Wwrite_strings)) CmdArgs.push_back("-fconst-strings"); } // GCC provides a macro definition '__DEPRECATED' when -Wdeprecated is active // during C++ compilation, which it is by default. GCC keeps this define even // in the presence of '-w', match this behavior bug-for-bug. if (types::isCXX(InputType) && Args.hasFlag(options::OPT_Wdeprecated, options::OPT_Wno_deprecated, true)) { CmdArgs.push_back("-fdeprecated-macro"); } // Translate GCC's misnamer '-fasm' arguments to '-fgnu-keywords'. if (Arg *Asm = Args.getLastArg(options::OPT_fasm, options::OPT_fno_asm)) { if (Asm->getOption().matches(options::OPT_fasm)) CmdArgs.push_back("-fgnu-keywords"); else CmdArgs.push_back("-fno-gnu-keywords"); } if (ShouldDisableDwarfDirectory(Args, getToolChain())) CmdArgs.push_back("-fno-dwarf-directory-asm"); if (ShouldDisableAutolink(Args, getToolChain())) CmdArgs.push_back("-fno-autolink"); // Add in -fdebug-compilation-dir if necessary. addDebugCompDirArg(Args, CmdArgs); addDebugPrefixMapArg(D, Args, CmdArgs); if (Arg *A = Args.getLastArg(options::OPT_ftemplate_depth_, options::OPT_ftemplate_depth_EQ)) { CmdArgs.push_back("-ftemplate-depth"); CmdArgs.push_back(A->getValue()); } if (Arg *A = Args.getLastArg(options::OPT_foperator_arrow_depth_EQ)) { CmdArgs.push_back("-foperator-arrow-depth"); CmdArgs.push_back(A->getValue()); } if (Arg *A = Args.getLastArg(options::OPT_fconstexpr_depth_EQ)) { CmdArgs.push_back("-fconstexpr-depth"); CmdArgs.push_back(A->getValue()); } if (Arg *A = Args.getLastArg(options::OPT_fconstexpr_steps_EQ)) { CmdArgs.push_back("-fconstexpr-steps"); CmdArgs.push_back(A->getValue()); } if (Arg *A = Args.getLastArg(options::OPT_fbracket_depth_EQ)) { CmdArgs.push_back("-fbracket-depth"); CmdArgs.push_back(A->getValue()); } if (Arg *A = Args.getLastArg(options::OPT_Wlarge_by_value_copy_EQ, options::OPT_Wlarge_by_value_copy_def)) { if (A->getNumValues()) { StringRef bytes = A->getValue(); CmdArgs.push_back(Args.MakeArgString("-Wlarge-by-value-copy=" + bytes)); } else CmdArgs.push_back("-Wlarge-by-value-copy=64"); // default value } if (Args.hasArg(options::OPT_relocatable_pch)) CmdArgs.push_back("-relocatable-pch"); if (Arg *A = Args.getLastArg(options::OPT_fconstant_string_class_EQ)) { CmdArgs.push_back("-fconstant-string-class"); CmdArgs.push_back(A->getValue()); } if (Arg *A = Args.getLastArg(options::OPT_ftabstop_EQ)) { CmdArgs.push_back("-ftabstop"); CmdArgs.push_back(A->getValue()); } if (Args.hasFlag(options::OPT_fstack_size_section, options::OPT_fno_stack_size_section, RawTriple.isPS4())) CmdArgs.push_back("-fstack-size-section"); CmdArgs.push_back("-ferror-limit"); if (Arg *A = Args.getLastArg(options::OPT_ferror_limit_EQ)) CmdArgs.push_back(A->getValue()); else CmdArgs.push_back("19"); if (Arg *A = Args.getLastArg(options::OPT_fmacro_backtrace_limit_EQ)) { CmdArgs.push_back("-fmacro-backtrace-limit"); CmdArgs.push_back(A->getValue()); } if (Arg *A = Args.getLastArg(options::OPT_ftemplate_backtrace_limit_EQ)) { CmdArgs.push_back("-ftemplate-backtrace-limit"); CmdArgs.push_back(A->getValue()); } if (Arg *A = Args.getLastArg(options::OPT_fconstexpr_backtrace_limit_EQ)) { CmdArgs.push_back("-fconstexpr-backtrace-limit"); CmdArgs.push_back(A->getValue()); } if (Arg *A = Args.getLastArg(options::OPT_fspell_checking_limit_EQ)) { CmdArgs.push_back("-fspell-checking-limit"); CmdArgs.push_back(A->getValue()); } // Pass -fmessage-length=. CmdArgs.push_back("-fmessage-length"); if (Arg *A = Args.getLastArg(options::OPT_fmessage_length_EQ)) { CmdArgs.push_back(A->getValue()); } else { // If -fmessage-length=N was not specified, determine whether this is a // terminal and, if so, implicitly define -fmessage-length appropriately. unsigned N = llvm::sys::Process::StandardErrColumns(); CmdArgs.push_back(Args.MakeArgString(Twine(N))); } // -fvisibility= and -fvisibility-ms-compat are of a piece. if (const Arg *A = Args.getLastArg(options::OPT_fvisibility_EQ, options::OPT_fvisibility_ms_compat)) { if (A->getOption().matches(options::OPT_fvisibility_EQ)) { CmdArgs.push_back("-fvisibility"); CmdArgs.push_back(A->getValue()); } else { assert(A->getOption().matches(options::OPT_fvisibility_ms_compat)); CmdArgs.push_back("-fvisibility"); CmdArgs.push_back("hidden"); CmdArgs.push_back("-ftype-visibility"); CmdArgs.push_back("default"); } } Args.AddLastArg(CmdArgs, options::OPT_fvisibility_inlines_hidden); Args.AddLastArg(CmdArgs, options::OPT_ftlsmodel_EQ); // Forward -f (flag) options which we can pass directly. Args.AddLastArg(CmdArgs, options::OPT_femit_all_decls); Args.AddLastArg(CmdArgs, options::OPT_fheinous_gnu_extensions); Args.AddLastArg(CmdArgs, options::OPT_fdigraphs, options::OPT_fno_digraphs); Args.AddLastArg(CmdArgs, options::OPT_fno_operator_names); Args.AddLastArg(CmdArgs, options::OPT_femulated_tls, options::OPT_fno_emulated_tls); // AltiVec-like language extensions aren't relevant for assembling. if (!isa(JA) || Output.getType() != types::TY_PP_Asm) Args.AddLastArg(CmdArgs, options::OPT_fzvector); Args.AddLastArg(CmdArgs, options::OPT_fdiagnostics_show_template_tree); Args.AddLastArg(CmdArgs, options::OPT_fno_elide_type); // Forward flags for OpenMP. We don't do this if the current action is an // device offloading action other than OpenMP. if (Args.hasFlag(options::OPT_fopenmp, options::OPT_fopenmp_EQ, options::OPT_fno_openmp, false) && (JA.isDeviceOffloading(Action::OFK_None) || JA.isDeviceOffloading(Action::OFK_OpenMP))) { switch (D.getOpenMPRuntime(Args)) { case Driver::OMPRT_OMP: case Driver::OMPRT_IOMP5: // Clang can generate useful OpenMP code for these two runtime libraries. CmdArgs.push_back("-fopenmp"); // If no option regarding the use of TLS in OpenMP codegeneration is // given, decide a default based on the target. Otherwise rely on the // options and pass the right information to the frontend. if (!Args.hasFlag(options::OPT_fopenmp_use_tls, options::OPT_fnoopenmp_use_tls, /*Default=*/true)) CmdArgs.push_back("-fnoopenmp-use-tls"); Args.AddLastArg(CmdArgs, options::OPT_fopenmp_simd, options::OPT_fno_openmp_simd); Args.AddAllArgs(CmdArgs, options::OPT_fopenmp_version_EQ); // When in OpenMP offloading mode with NVPTX target, forward // cuda-mode flag Args.AddLastArg(CmdArgs, options::OPT_fopenmp_cuda_mode, options::OPT_fno_openmp_cuda_mode); break; default: // By default, if Clang doesn't know how to generate useful OpenMP code // for a specific runtime library, we just don't pass the '-fopenmp' flag // down to the actual compilation. // FIXME: It would be better to have a mode which *only* omits IR // generation based on the OpenMP support so that we get consistent // semantic analysis, etc. break; } } else { Args.AddLastArg(CmdArgs, options::OPT_fopenmp_simd, options::OPT_fno_openmp_simd); Args.AddAllArgs(CmdArgs, options::OPT_fopenmp_version_EQ); } const SanitizerArgs &Sanitize = getToolChain().getSanitizerArgs(); Sanitize.addArgs(getToolChain(), Args, CmdArgs, InputType); const XRayArgs &XRay = getToolChain().getXRayArgs(); XRay.addArgs(getToolChain(), Args, CmdArgs, InputType); if (getToolChain().SupportsProfiling()) Args.AddLastArg(CmdArgs, options::OPT_pg); if (getToolChain().SupportsProfiling()) Args.AddLastArg(CmdArgs, options::OPT_mfentry); // -flax-vector-conversions is default. if (!Args.hasFlag(options::OPT_flax_vector_conversions, options::OPT_fno_lax_vector_conversions)) CmdArgs.push_back("-fno-lax-vector-conversions"); if (Args.getLastArg(options::OPT_fapple_kext) || (Args.hasArg(options::OPT_mkernel) && types::isCXX(InputType))) CmdArgs.push_back("-fapple-kext"); Args.AddLastArg(CmdArgs, options::OPT_fobjc_sender_dependent_dispatch); Args.AddLastArg(CmdArgs, options::OPT_fdiagnostics_print_source_range_info); Args.AddLastArg(CmdArgs, options::OPT_fdiagnostics_parseable_fixits); Args.AddLastArg(CmdArgs, options::OPT_ftime_report); Args.AddLastArg(CmdArgs, options::OPT_ftrapv); if (Arg *A = Args.getLastArg(options::OPT_ftrapv_handler_EQ)) { CmdArgs.push_back("-ftrapv-handler"); CmdArgs.push_back(A->getValue()); } Args.AddLastArg(CmdArgs, options::OPT_ftrap_function_EQ); // -fno-strict-overflow implies -fwrapv if it isn't disabled, but // -fstrict-overflow won't turn off an explicitly enabled -fwrapv. if (Arg *A = Args.getLastArg(options::OPT_fwrapv, options::OPT_fno_wrapv)) { if (A->getOption().matches(options::OPT_fwrapv)) CmdArgs.push_back("-fwrapv"); } else if (Arg *A = Args.getLastArg(options::OPT_fstrict_overflow, options::OPT_fno_strict_overflow)) { if (A->getOption().matches(options::OPT_fno_strict_overflow)) CmdArgs.push_back("-fwrapv"); } if (Arg *A = Args.getLastArg(options::OPT_freroll_loops, options::OPT_fno_reroll_loops)) if (A->getOption().matches(options::OPT_freroll_loops)) CmdArgs.push_back("-freroll-loops"); Args.AddLastArg(CmdArgs, options::OPT_fwritable_strings); Args.AddLastArg(CmdArgs, options::OPT_funroll_loops, options::OPT_fno_unroll_loops); Args.AddLastArg(CmdArgs, options::OPT_pthread); RenderSSPOptions(getToolChain(), Args, CmdArgs, KernelOrKext); // Translate -mstackrealign if (Args.hasFlag(options::OPT_mstackrealign, options::OPT_mno_stackrealign, false)) CmdArgs.push_back(Args.MakeArgString("-mstackrealign")); if (Args.hasArg(options::OPT_mstack_alignment)) { StringRef alignment = Args.getLastArgValue(options::OPT_mstack_alignment); CmdArgs.push_back(Args.MakeArgString("-mstack-alignment=" + alignment)); } if (Args.hasArg(options::OPT_mstack_probe_size)) { StringRef Size = Args.getLastArgValue(options::OPT_mstack_probe_size); if (!Size.empty()) CmdArgs.push_back(Args.MakeArgString("-mstack-probe-size=" + Size)); else CmdArgs.push_back("-mstack-probe-size=0"); } if (!Args.hasFlag(options::OPT_mstack_arg_probe, options::OPT_mno_stack_arg_probe, true)) CmdArgs.push_back(Args.MakeArgString("-mno-stack-arg-probe")); if (Arg *A = Args.getLastArg(options::OPT_mrestrict_it, options::OPT_mno_restrict_it)) { if (A->getOption().matches(options::OPT_mrestrict_it)) { CmdArgs.push_back("-mllvm"); CmdArgs.push_back("-arm-restrict-it"); } else { CmdArgs.push_back("-mllvm"); CmdArgs.push_back("-arm-no-restrict-it"); } } else if (Triple.isOSWindows() && (Triple.getArch() == llvm::Triple::arm || Triple.getArch() == llvm::Triple::thumb)) { // Windows on ARM expects restricted IT blocks CmdArgs.push_back("-mllvm"); CmdArgs.push_back("-arm-restrict-it"); } // Forward -cl options to -cc1 RenderOpenCLOptions(Args, CmdArgs); if (Arg *A = Args.getLastArg(options::OPT_fcf_protection_EQ)) { CmdArgs.push_back( Args.MakeArgString(Twine("-fcf-protection=") + A->getValue())); } // Forward -f options with positive and negative forms; we translate // these by hand. if (Arg *A = getLastProfileSampleUseArg(Args)) { StringRef fname = A->getValue(); if (!llvm::sys::fs::exists(fname)) D.Diag(diag::err_drv_no_such_file) << fname; else A->render(Args, CmdArgs); } RenderBuiltinOptions(getToolChain(), RawTriple, Args, CmdArgs); if (!Args.hasFlag(options::OPT_fassume_sane_operator_new, options::OPT_fno_assume_sane_operator_new)) CmdArgs.push_back("-fno-assume-sane-operator-new"); // -fblocks=0 is default. if (Args.hasFlag(options::OPT_fblocks, options::OPT_fno_blocks, getToolChain().IsBlocksDefault()) || (Args.hasArg(options::OPT_fgnu_runtime) && Args.hasArg(options::OPT_fobjc_nonfragile_abi) && !Args.hasArg(options::OPT_fno_blocks))) { CmdArgs.push_back("-fblocks"); if (!Args.hasArg(options::OPT_fgnu_runtime) && !getToolChain().hasBlocksRuntime()) CmdArgs.push_back("-fblocks-runtime-optional"); } // -fencode-extended-block-signature=1 is default. if (getToolChain().IsEncodeExtendedBlockSignatureDefault()) CmdArgs.push_back("-fencode-extended-block-signature"); if (Args.hasFlag(options::OPT_fcoroutines_ts, options::OPT_fno_coroutines_ts, false) && types::isCXX(InputType)) { CmdArgs.push_back("-fcoroutines-ts"); } Args.AddLastArg(CmdArgs, options::OPT_fdouble_square_bracket_attributes, options::OPT_fno_double_square_bracket_attributes); bool HaveModules = false; RenderModulesOptions(C, D, Args, Input, Output, CmdArgs, HaveModules); // -faccess-control is default. if (Args.hasFlag(options::OPT_fno_access_control, options::OPT_faccess_control, false)) CmdArgs.push_back("-fno-access-control"); // -felide-constructors is the default. if (Args.hasFlag(options::OPT_fno_elide_constructors, options::OPT_felide_constructors, false)) CmdArgs.push_back("-fno-elide-constructors"); ToolChain::RTTIMode RTTIMode = getToolChain().getRTTIMode(); if (KernelOrKext || (types::isCXX(InputType) && (RTTIMode == ToolChain::RM_Disabled))) CmdArgs.push_back("-fno-rtti"); // -fshort-enums=0 is default for all architectures except Hexagon. if (Args.hasFlag(options::OPT_fshort_enums, options::OPT_fno_short_enums, getToolChain().getArch() == llvm::Triple::hexagon)) CmdArgs.push_back("-fshort-enums"); RenderCharacterOptions(Args, AuxTriple ? *AuxTriple : RawTriple, CmdArgs); // -fuse-cxa-atexit is default. if (!Args.hasFlag( options::OPT_fuse_cxa_atexit, options::OPT_fno_use_cxa_atexit, !RawTriple.isOSWindows() && RawTriple.getOS() != llvm::Triple::Solaris && getToolChain().getArch() != llvm::Triple::hexagon && getToolChain().getArch() != llvm::Triple::xcore && ((RawTriple.getVendor() != llvm::Triple::MipsTechnologies) || RawTriple.hasEnvironment())) || KernelOrKext) CmdArgs.push_back("-fno-use-cxa-atexit"); if (Args.hasFlag(options::OPT_fregister_global_dtors_with_atexit, options::OPT_fno_register_global_dtors_with_atexit, RawTriple.isOSDarwin() && !KernelOrKext)) CmdArgs.push_back("-fregister-global-dtors-with-atexit"); // -fms-extensions=0 is default. if (Args.hasFlag(options::OPT_fms_extensions, options::OPT_fno_ms_extensions, IsWindowsMSVC)) CmdArgs.push_back("-fms-extensions"); // -fno-use-line-directives is default. if (Args.hasFlag(options::OPT_fuse_line_directives, options::OPT_fno_use_line_directives, false)) CmdArgs.push_back("-fuse-line-directives"); // -fms-compatibility=0 is default. if (Args.hasFlag(options::OPT_fms_compatibility, options::OPT_fno_ms_compatibility, (IsWindowsMSVC && Args.hasFlag(options::OPT_fms_extensions, options::OPT_fno_ms_extensions, true)))) CmdArgs.push_back("-fms-compatibility"); VersionTuple MSVT = getToolChain().computeMSVCVersion(&D, Args); if (!MSVT.empty()) CmdArgs.push_back( Args.MakeArgString("-fms-compatibility-version=" + MSVT.getAsString())); bool IsMSVC2015Compatible = MSVT.getMajor() >= 19; if (ImplyVCPPCXXVer) { StringRef LanguageStandard; if (const Arg *StdArg = Args.getLastArg(options::OPT__SLASH_std)) { LanguageStandard = llvm::StringSwitch(StdArg->getValue()) .Case("c++14", "-std=c++14") .Case("c++17", "-std=c++17") .Case("c++latest", "-std=c++2a") .Default(""); if (LanguageStandard.empty()) D.Diag(clang::diag::warn_drv_unused_argument) << StdArg->getAsString(Args); } if (LanguageStandard.empty()) { if (IsMSVC2015Compatible) LanguageStandard = "-std=c++14"; else LanguageStandard = "-std=c++11"; } CmdArgs.push_back(LanguageStandard.data()); } // -fno-borland-extensions is default. if (Args.hasFlag(options::OPT_fborland_extensions, options::OPT_fno_borland_extensions, false)) CmdArgs.push_back("-fborland-extensions"); // -fno-declspec is default, except for PS4. if (Args.hasFlag(options::OPT_fdeclspec, options::OPT_fno_declspec, RawTriple.isPS4())) CmdArgs.push_back("-fdeclspec"); else if (Args.hasArg(options::OPT_fno_declspec)) CmdArgs.push_back("-fno-declspec"); // Explicitly disabling __declspec. // -fthreadsafe-static is default, except for MSVC compatibility versions less // than 19. if (!Args.hasFlag(options::OPT_fthreadsafe_statics, options::OPT_fno_threadsafe_statics, !IsWindowsMSVC || IsMSVC2015Compatible)) CmdArgs.push_back("-fno-threadsafe-statics"); // -fno-delayed-template-parsing is default, except when targeting MSVC. // Many old Windows SDK versions require this to parse. // FIXME: MSVC introduced /Zc:twoPhase- to disable this behavior in their // compiler. We should be able to disable this by default at some point. if (Args.hasFlag(options::OPT_fdelayed_template_parsing, options::OPT_fno_delayed_template_parsing, IsWindowsMSVC)) CmdArgs.push_back("-fdelayed-template-parsing"); // -fgnu-keywords default varies depending on language; only pass if // specified. if (Arg *A = Args.getLastArg(options::OPT_fgnu_keywords, options::OPT_fno_gnu_keywords)) A->render(Args, CmdArgs); if (Args.hasFlag(options::OPT_fgnu89_inline, options::OPT_fno_gnu89_inline, false)) CmdArgs.push_back("-fgnu89-inline"); if (Args.hasArg(options::OPT_fno_inline)) CmdArgs.push_back("-fno-inline"); if (Arg* InlineArg = Args.getLastArg(options::OPT_finline_functions, options::OPT_finline_hint_functions, options::OPT_fno_inline_functions)) InlineArg->render(Args, CmdArgs); Args.AddLastArg(CmdArgs, options::OPT_fexperimental_new_pass_manager, options::OPT_fno_experimental_new_pass_manager); ObjCRuntime Runtime = AddObjCRuntimeArgs(Args, CmdArgs, rewriteKind); RenderObjCOptions(getToolChain(), D, RawTriple, Args, Runtime, rewriteKind != RK_None, Input, CmdArgs); if (Args.hasFlag(options::OPT_fapplication_extension, options::OPT_fno_application_extension, false)) CmdArgs.push_back("-fapplication-extension"); // Handle GCC-style exception args. if (!C.getDriver().IsCLMode()) addExceptionArgs(Args, InputType, getToolChain(), KernelOrKext, Runtime, CmdArgs); // Handle exception personalities Arg *A = Args.getLastArg(options::OPT_fsjlj_exceptions, options::OPT_fseh_exceptions, options::OPT_fdwarf_exceptions); if (A) { const Option &Opt = A->getOption(); if (Opt.matches(options::OPT_fsjlj_exceptions)) CmdArgs.push_back("-fsjlj-exceptions"); if (Opt.matches(options::OPT_fseh_exceptions)) CmdArgs.push_back("-fseh-exceptions"); if (Opt.matches(options::OPT_fdwarf_exceptions)) CmdArgs.push_back("-fdwarf-exceptions"); } else { switch (getToolChain().GetExceptionModel(Args)) { default: break; case llvm::ExceptionHandling::DwarfCFI: CmdArgs.push_back("-fdwarf-exceptions"); break; case llvm::ExceptionHandling::SjLj: CmdArgs.push_back("-fsjlj-exceptions"); break; case llvm::ExceptionHandling::WinEH: CmdArgs.push_back("-fseh-exceptions"); break; } } // C++ "sane" operator new. if (!Args.hasFlag(options::OPT_fassume_sane_operator_new, options::OPT_fno_assume_sane_operator_new)) CmdArgs.push_back("-fno-assume-sane-operator-new"); // -frelaxed-template-template-args is off by default, as it is a severe // breaking change until a corresponding change to template partial ordering // is provided. if (Args.hasFlag(options::OPT_frelaxed_template_template_args, options::OPT_fno_relaxed_template_template_args, false)) CmdArgs.push_back("-frelaxed-template-template-args"); // -fsized-deallocation is off by default, as it is an ABI-breaking change for // most platforms. if (Args.hasFlag(options::OPT_fsized_deallocation, options::OPT_fno_sized_deallocation, false)) CmdArgs.push_back("-fsized-deallocation"); // -faligned-allocation is on by default in C++17 onwards and otherwise off // by default. if (Arg *A = Args.getLastArg(options::OPT_faligned_allocation, options::OPT_fno_aligned_allocation, options::OPT_faligned_new_EQ)) { if (A->getOption().matches(options::OPT_fno_aligned_allocation)) CmdArgs.push_back("-fno-aligned-allocation"); else CmdArgs.push_back("-faligned-allocation"); } // The default new alignment can be specified using a dedicated option or via // a GCC-compatible option that also turns on aligned allocation. if (Arg *A = Args.getLastArg(options::OPT_fnew_alignment_EQ, options::OPT_faligned_new_EQ)) CmdArgs.push_back( Args.MakeArgString(Twine("-fnew-alignment=") + A->getValue())); // -fconstant-cfstrings is default, and may be subject to argument translation // on Darwin. if (!Args.hasFlag(options::OPT_fconstant_cfstrings, options::OPT_fno_constant_cfstrings) || !Args.hasFlag(options::OPT_mconstant_cfstrings, options::OPT_mno_constant_cfstrings)) CmdArgs.push_back("-fno-constant-cfstrings"); // -fno-pascal-strings is default, only pass non-default. if (Args.hasFlag(options::OPT_fpascal_strings, options::OPT_fno_pascal_strings, false)) CmdArgs.push_back("-fpascal-strings"); // Honor -fpack-struct= and -fpack-struct, if given. Note that // -fno-pack-struct doesn't apply to -fpack-struct=. if (Arg *A = Args.getLastArg(options::OPT_fpack_struct_EQ)) { std::string PackStructStr = "-fpack-struct="; PackStructStr += A->getValue(); CmdArgs.push_back(Args.MakeArgString(PackStructStr)); } else if (Args.hasFlag(options::OPT_fpack_struct, options::OPT_fno_pack_struct, false)) { CmdArgs.push_back("-fpack-struct=1"); } // Handle -fmax-type-align=N and -fno-type-align bool SkipMaxTypeAlign = Args.hasArg(options::OPT_fno_max_type_align); if (Arg *A = Args.getLastArg(options::OPT_fmax_type_align_EQ)) { if (!SkipMaxTypeAlign) { std::string MaxTypeAlignStr = "-fmax-type-align="; MaxTypeAlignStr += A->getValue(); CmdArgs.push_back(Args.MakeArgString(MaxTypeAlignStr)); } } else if (RawTriple.isOSDarwin()) { if (!SkipMaxTypeAlign) { std::string MaxTypeAlignStr = "-fmax-type-align=16"; CmdArgs.push_back(Args.MakeArgString(MaxTypeAlignStr)); } } if (!Args.hasFlag(options::OPT_Qy, options::OPT_Qn, true)) CmdArgs.push_back("-Qn"); // -fcommon is the default unless compiling kernel code or the target says so bool NoCommonDefault = KernelOrKext || isNoCommonDefault(RawTriple); if (!Args.hasFlag(options::OPT_fcommon, options::OPT_fno_common, !NoCommonDefault)) CmdArgs.push_back("-fno-common"); // -fsigned-bitfields is default, and clang doesn't yet support // -funsigned-bitfields. if (!Args.hasFlag(options::OPT_fsigned_bitfields, options::OPT_funsigned_bitfields)) D.Diag(diag::warn_drv_clang_unsupported) << Args.getLastArg(options::OPT_funsigned_bitfields)->getAsString(Args); // -fsigned-bitfields is default, and clang doesn't support -fno-for-scope. if (!Args.hasFlag(options::OPT_ffor_scope, options::OPT_fno_for_scope)) D.Diag(diag::err_drv_clang_unsupported) << Args.getLastArg(options::OPT_fno_for_scope)->getAsString(Args); // -finput_charset=UTF-8 is default. Reject others if (Arg *inputCharset = Args.getLastArg(options::OPT_finput_charset_EQ)) { StringRef value = inputCharset->getValue(); if (!value.equals_lower("utf-8")) D.Diag(diag::err_drv_invalid_value) << inputCharset->getAsString(Args) << value; } // -fexec_charset=UTF-8 is default. Reject others if (Arg *execCharset = Args.getLastArg(options::OPT_fexec_charset_EQ)) { StringRef value = execCharset->getValue(); if (!value.equals_lower("utf-8")) D.Diag(diag::err_drv_invalid_value) << execCharset->getAsString(Args) << value; } RenderDiagnosticsOptions(D, Args, CmdArgs); // -fno-asm-blocks is default. if (Args.hasFlag(options::OPT_fasm_blocks, options::OPT_fno_asm_blocks, false)) CmdArgs.push_back("-fasm-blocks"); // -fgnu-inline-asm is default. if (!Args.hasFlag(options::OPT_fgnu_inline_asm, options::OPT_fno_gnu_inline_asm, true)) CmdArgs.push_back("-fno-gnu-inline-asm"); // Enable vectorization per default according to the optimization level // selected. For optimization levels that want vectorization we use the alias // option to simplify the hasFlag logic. bool EnableVec = shouldEnableVectorizerAtOLevel(Args, false); OptSpecifier VectorizeAliasOption = EnableVec ? options::OPT_O_Group : options::OPT_fvectorize; if (Args.hasFlag(options::OPT_fvectorize, VectorizeAliasOption, options::OPT_fno_vectorize, EnableVec)) CmdArgs.push_back("-vectorize-loops"); // -fslp-vectorize is enabled based on the optimization level selected. bool EnableSLPVec = shouldEnableVectorizerAtOLevel(Args, true); OptSpecifier SLPVectAliasOption = EnableSLPVec ? options::OPT_O_Group : options::OPT_fslp_vectorize; if (Args.hasFlag(options::OPT_fslp_vectorize, SLPVectAliasOption, options::OPT_fno_slp_vectorize, EnableSLPVec)) CmdArgs.push_back("-vectorize-slp"); ParseMPreferVectorWidth(D, Args, CmdArgs); if (Arg *A = Args.getLastArg(options::OPT_fshow_overloads_EQ)) A->render(Args, CmdArgs); if (Arg *A = Args.getLastArg( options::OPT_fsanitize_undefined_strip_path_components_EQ)) A->render(Args, CmdArgs); // -fdollars-in-identifiers default varies depending on platform and // language; only pass if specified. if (Arg *A = Args.getLastArg(options::OPT_fdollars_in_identifiers, options::OPT_fno_dollars_in_identifiers)) { if (A->getOption().matches(options::OPT_fdollars_in_identifiers)) CmdArgs.push_back("-fdollars-in-identifiers"); else CmdArgs.push_back("-fno-dollars-in-identifiers"); } // -funit-at-a-time is default, and we don't support -fno-unit-at-a-time for // practical purposes. if (Arg *A = Args.getLastArg(options::OPT_funit_at_a_time, options::OPT_fno_unit_at_a_time)) { if (A->getOption().matches(options::OPT_fno_unit_at_a_time)) D.Diag(diag::warn_drv_clang_unsupported) << A->getAsString(Args); } if (Args.hasFlag(options::OPT_fapple_pragma_pack, options::OPT_fno_apple_pragma_pack, false)) CmdArgs.push_back("-fapple-pragma-pack"); if (Args.hasFlag(options::OPT_fsave_optimization_record, options::OPT_foptimization_record_file_EQ, options::OPT_fno_save_optimization_record, false)) { CmdArgs.push_back("-opt-record-file"); const Arg *A = Args.getLastArg(options::OPT_foptimization_record_file_EQ); if (A) { CmdArgs.push_back(A->getValue()); } else { SmallString<128> F; if (Args.hasArg(options::OPT_c) || Args.hasArg(options::OPT_S)) { if (Arg *FinalOutput = Args.getLastArg(options::OPT_o)) F = FinalOutput->getValue(); } if (F.empty()) { // Use the input filename. F = llvm::sys::path::stem(Input.getBaseInput()); // If we're compiling for an offload architecture (i.e. a CUDA device), // we need to make the file name for the device compilation different // from the host compilation. if (!JA.isDeviceOffloading(Action::OFK_None) && !JA.isDeviceOffloading(Action::OFK_Host)) { llvm::sys::path::replace_extension(F, ""); F += Action::GetOffloadingFileNamePrefix(JA.getOffloadingDeviceKind(), Triple.normalize()); F += "-"; F += JA.getOffloadingArch(); } } llvm::sys::path::replace_extension(F, "opt.yaml"); CmdArgs.push_back(Args.MakeArgString(F)); } } bool RewriteImports = Args.hasFlag(options::OPT_frewrite_imports, options::OPT_fno_rewrite_imports, false); if (RewriteImports) CmdArgs.push_back("-frewrite-imports"); // Enable rewrite includes if the user's asked for it or if we're generating // diagnostics. // TODO: Once -module-dependency-dir works with -frewrite-includes it'd be // nice to enable this when doing a crashdump for modules as well. if (Args.hasFlag(options::OPT_frewrite_includes, options::OPT_fno_rewrite_includes, false) || (C.isForDiagnostics() && (RewriteImports || !HaveModules))) CmdArgs.push_back("-frewrite-includes"); // Only allow -traditional or -traditional-cpp outside in preprocessing modes. if (Arg *A = Args.getLastArg(options::OPT_traditional, options::OPT_traditional_cpp)) { if (isa(JA)) CmdArgs.push_back("-traditional-cpp"); else D.Diag(diag::err_drv_clang_unsupported) << A->getAsString(Args); } Args.AddLastArg(CmdArgs, options::OPT_dM); Args.AddLastArg(CmdArgs, options::OPT_dD); // Handle serialized diagnostics. if (Arg *A = Args.getLastArg(options::OPT__serialize_diags)) { CmdArgs.push_back("-serialize-diagnostic-file"); CmdArgs.push_back(Args.MakeArgString(A->getValue())); } if (Args.hasArg(options::OPT_fretain_comments_from_system_headers)) CmdArgs.push_back("-fretain-comments-from-system-headers"); // Forward -fcomment-block-commands to -cc1. Args.AddAllArgs(CmdArgs, options::OPT_fcomment_block_commands); // Forward -fparse-all-comments to -cc1. Args.AddAllArgs(CmdArgs, options::OPT_fparse_all_comments); // Turn -fplugin=name.so into -load name.so for (const Arg *A : Args.filtered(options::OPT_fplugin_EQ)) { CmdArgs.push_back("-load"); CmdArgs.push_back(A->getValue()); A->claim(); } // Setup statistics file output. SmallString<128> StatsFile = getStatsFileName(Args, Output, Input, D); if (!StatsFile.empty()) CmdArgs.push_back(Args.MakeArgString(Twine("-stats-file=") + StatsFile)); // Forward -Xclang arguments to -cc1, and -mllvm arguments to the LLVM option // parser. // -finclude-default-header flag is for preprocessor, // do not pass it to other cc1 commands when save-temps is enabled if (C.getDriver().isSaveTempsEnabled() && !isa(JA)) { for (auto Arg : Args.filtered(options::OPT_Xclang)) { Arg->claim(); if (StringRef(Arg->getValue()) != "-finclude-default-header") CmdArgs.push_back(Arg->getValue()); } } else { Args.AddAllArgValues(CmdArgs, options::OPT_Xclang); } for (const Arg *A : Args.filtered(options::OPT_mllvm)) { A->claim(); // We translate this by hand to the -cc1 argument, since nightly test uses // it and developers have been trained to spell it with -mllvm. Both // spellings are now deprecated and should be removed. if (StringRef(A->getValue(0)) == "-disable-llvm-optzns") { CmdArgs.push_back("-disable-llvm-optzns"); } else { A->render(Args, CmdArgs); } } // With -save-temps, we want to save the unoptimized bitcode output from the // CompileJobAction, use -disable-llvm-passes to get pristine IR generated // by the frontend. // When -fembed-bitcode is enabled, optimized bitcode is emitted because it // has slightly different breakdown between stages. // FIXME: -fembed-bitcode -save-temps will save optimized bitcode instead of // pristine IR generated by the frontend. Ideally, a new compile action should // be added so both IR can be captured. if (C.getDriver().isSaveTempsEnabled() && !(C.getDriver().embedBitcodeInObject() && !C.getDriver().isUsingLTO()) && isa(JA)) CmdArgs.push_back("-disable-llvm-passes"); if (Output.getType() == types::TY_Dependencies) { // Handled with other dependency code. } else if (Output.isFilename()) { CmdArgs.push_back("-o"); CmdArgs.push_back(Output.getFilename()); } else { assert(Output.isNothing() && "Invalid output."); } addDashXForInput(Args, Input, CmdArgs); if (Input.isFilename()) CmdArgs.push_back(Input.getFilename()); else Input.getInputArg().renderAsInput(Args, CmdArgs); Args.AddAllArgs(CmdArgs, options::OPT_undef); const char *Exec = D.getClangProgramPath(); // Optionally embed the -cc1 level arguments into the debug info, for build // analysis. // Also record command line arguments into the debug info if // -grecord-gcc-switches options is set on. // By default, -gno-record-gcc-switches is set on and no recording. if (getToolChain().UseDwarfDebugFlags() || Args.hasFlag(options::OPT_grecord_gcc_switches, options::OPT_gno_record_gcc_switches, false)) { ArgStringList OriginalArgs; for (const auto &Arg : Args) Arg->render(Args, OriginalArgs); SmallString<256> Flags; Flags += Exec; for (const char *OriginalArg : OriginalArgs) { SmallString<128> EscapedArg; EscapeSpacesAndBackslashes(OriginalArg, EscapedArg); Flags += " "; Flags += EscapedArg; } CmdArgs.push_back("-dwarf-debug-flags"); CmdArgs.push_back(Args.MakeArgString(Flags)); } if (IsCuda) { // Host-side cuda compilation receives all device-side outputs in a single // fatbin as Inputs[1]. Include the binary with -fcuda-include-gpubinary. if (Inputs.size() > 1) { assert(Inputs.size() == 2 && "More than one GPU binary!"); CmdArgs.push_back("-fcuda-include-gpubinary"); CmdArgs.push_back(Inputs[1].getFilename()); } if (Args.hasFlag(options::OPT_fcuda_rdc, options::OPT_fno_cuda_rdc, false)) CmdArgs.push_back("-fcuda-rdc"); if (Args.hasFlag(options::OPT_fcuda_short_ptr, options::OPT_fno_cuda_short_ptr, false)) CmdArgs.push_back("-fcuda-short-ptr"); } // OpenMP offloading device jobs take the argument -fopenmp-host-ir-file-path // to specify the result of the compile phase on the host, so the meaningful // device declarations can be identified. Also, -fopenmp-is-device is passed // along to tell the frontend that it is generating code for a device, so that // only the relevant declarations are emitted. if (IsOpenMPDevice) { CmdArgs.push_back("-fopenmp-is-device"); if (Inputs.size() == 2) { CmdArgs.push_back("-fopenmp-host-ir-file-path"); CmdArgs.push_back(Args.MakeArgString(Inputs.back().getFilename())); } } // For all the host OpenMP offloading compile jobs we need to pass the targets // information using -fopenmp-targets= option. if (JA.isHostOffloading(Action::OFK_OpenMP)) { SmallString<128> TargetInfo("-fopenmp-targets="); Arg *Tgts = Args.getLastArg(options::OPT_fopenmp_targets_EQ); assert(Tgts && Tgts->getNumValues() && "OpenMP offloading has to have targets specified."); for (unsigned i = 0; i < Tgts->getNumValues(); ++i) { if (i) TargetInfo += ','; // We need to get the string from the triple because it may be not exactly // the same as the one we get directly from the arguments. llvm::Triple T(Tgts->getValue(i)); TargetInfo += T.getTriple(); } CmdArgs.push_back(Args.MakeArgString(TargetInfo.str())); } bool WholeProgramVTables = Args.hasFlag(options::OPT_fwhole_program_vtables, options::OPT_fno_whole_program_vtables, false); if (WholeProgramVTables) { if (!D.isUsingLTO()) D.Diag(diag::err_drv_argument_only_allowed_with) << "-fwhole-program-vtables" << "-flto"; CmdArgs.push_back("-fwhole-program-vtables"); } if (Arg *A = Args.getLastArg(options::OPT_fexperimental_isel, options::OPT_fno_experimental_isel)) { CmdArgs.push_back("-mllvm"); if (A->getOption().matches(options::OPT_fexperimental_isel)) { CmdArgs.push_back("-global-isel=1"); // GISel is on by default on AArch64 -O0, so don't bother adding // the fallback remarks for it. Other combinations will add a warning of // some kind. bool IsArchSupported = Triple.getArch() == llvm::Triple::aarch64; bool IsOptLevelSupported = false; Arg *A = Args.getLastArg(options::OPT_O_Group); if (Triple.getArch() == llvm::Triple::aarch64) { if (!A || A->getOption().matches(options::OPT_O0)) IsOptLevelSupported = true; } if (!IsArchSupported || !IsOptLevelSupported) { CmdArgs.push_back("-mllvm"); CmdArgs.push_back("-global-isel-abort=2"); if (!IsArchSupported) D.Diag(diag::warn_drv_experimental_isel_incomplete) << Triple.getArchName(); else D.Diag(diag::warn_drv_experimental_isel_incomplete_opt); } } else { CmdArgs.push_back("-global-isel=0"); } } if (Arg *A = Args.getLastArg(options::OPT_fforce_enable_int128, options::OPT_fno_force_enable_int128)) { if (A->getOption().matches(options::OPT_fforce_enable_int128)) CmdArgs.push_back("-fforce-enable-int128"); } if (Args.hasFlag(options::OPT_fcomplete_member_pointers, options::OPT_fno_complete_member_pointers, false)) CmdArgs.push_back("-fcomplete-member-pointers"); if (Arg *A = Args.getLastArg(options::OPT_moutline, options::OPT_mno_outline)) { if (A->getOption().matches(options::OPT_moutline)) { // We only support -moutline in AArch64 right now. If we're not compiling // for AArch64, emit a warning and ignore the flag. Otherwise, add the // proper mllvm flags. if (Triple.getArch() != llvm::Triple::aarch64) { D.Diag(diag::warn_drv_moutline_unsupported_opt) << Triple.getArchName(); } else { CmdArgs.push_back("-mllvm"); CmdArgs.push_back("-enable-machine-outliner"); } } else { // Disable all outlining behaviour. CmdArgs.push_back("-mllvm"); CmdArgs.push_back("-enable-machine-outliner=never"); } } if (Args.hasFlag(options::OPT_faddrsig, options::OPT_fno_addrsig, getToolChain().getTriple().isOSBinFormatELF() && getToolChain().useIntegratedAs())) CmdArgs.push_back("-faddrsig"); // Finally add the compile command to the compilation. if (Args.hasArg(options::OPT__SLASH_fallback) && Output.getType() == types::TY_Object && (InputType == types::TY_C || InputType == types::TY_CXX)) { auto CLCommand = getCLFallback()->GetCommand(C, JA, Output, Inputs, Args, LinkingOutput); C.addCommand(llvm::make_unique( JA, *this, Exec, CmdArgs, Inputs, std::move(CLCommand))); } else if (Args.hasArg(options::OPT__SLASH_fallback) && isa(JA)) { // In /fallback builds, run the main compilation even if the pch generation // fails, so that the main compilation's fallback to cl.exe runs. C.addCommand(llvm::make_unique(JA, *this, Exec, CmdArgs, Inputs)); } else { C.addCommand(llvm::make_unique(JA, *this, Exec, CmdArgs, Inputs)); } if (Arg *A = Args.getLastArg(options::OPT_pg)) if (Args.hasArg(options::OPT_fomit_frame_pointer)) D.Diag(diag::err_drv_argument_not_allowed_with) << "-fomit-frame-pointer" << A->getAsString(Args); // Claim some arguments which clang supports automatically. // -fpch-preprocess is used with gcc to add a special marker in the output to // include the PCH file. Clang's PTH solution is completely transparent, so we // do not need to deal with it at all. Args.ClaimAllArgs(options::OPT_fpch_preprocess); // Claim some arguments which clang doesn't support, but we don't // care to warn the user about. Args.ClaimAllArgs(options::OPT_clang_ignored_f_Group); Args.ClaimAllArgs(options::OPT_clang_ignored_m_Group); // Disable warnings for clang -E -emit-llvm foo.c Args.ClaimAllArgs(options::OPT_emit_llvm); } Clang::Clang(const ToolChain &TC) // CAUTION! The first constructor argument ("clang") is not arbitrary, // as it is for other tools. Some operations on a Tool actually test // whether that tool is Clang based on the Tool's Name as a string. : Tool("clang", "clang frontend", TC, RF_Full) {} Clang::~Clang() {} /// Add options related to the Objective-C runtime/ABI. /// /// Returns true if the runtime is non-fragile. ObjCRuntime Clang::AddObjCRuntimeArgs(const ArgList &args, ArgStringList &cmdArgs, RewriteKind rewriteKind) const { // Look for the controlling runtime option. Arg *runtimeArg = args.getLastArg(options::OPT_fnext_runtime, options::OPT_fgnu_runtime, options::OPT_fobjc_runtime_EQ); // Just forward -fobjc-runtime= to the frontend. This supercedes // options about fragility. if (runtimeArg && runtimeArg->getOption().matches(options::OPT_fobjc_runtime_EQ)) { ObjCRuntime runtime; StringRef value = runtimeArg->getValue(); if (runtime.tryParse(value)) { getToolChain().getDriver().Diag(diag::err_drv_unknown_objc_runtime) << value; } if ((runtime.getKind() == ObjCRuntime::GNUstep) && (runtime.getVersion() >= VersionTuple(2, 0))) - if (!getToolChain().getTriple().isOSBinFormatELF() && - !getToolChain().getTriple().isOSBinFormatCOFF()) { + if (!getToolChain().getTriple().isOSBinFormatELF()) { getToolChain().getDriver().Diag( diag::err_drv_gnustep_objc_runtime_incompatible_binary) << runtime.getVersion().getMajor(); } runtimeArg->render(args, cmdArgs); return runtime; } // Otherwise, we'll need the ABI "version". Version numbers are // slightly confusing for historical reasons: // 1 - Traditional "fragile" ABI // 2 - Non-fragile ABI, version 1 // 3 - Non-fragile ABI, version 2 unsigned objcABIVersion = 1; // If -fobjc-abi-version= is present, use that to set the version. if (Arg *abiArg = args.getLastArg(options::OPT_fobjc_abi_version_EQ)) { StringRef value = abiArg->getValue(); if (value == "1") objcABIVersion = 1; else if (value == "2") objcABIVersion = 2; else if (value == "3") objcABIVersion = 3; else getToolChain().getDriver().Diag(diag::err_drv_clang_unsupported) << value; } else { // Otherwise, determine if we are using the non-fragile ABI. bool nonFragileABIIsDefault = (rewriteKind == RK_NonFragile || (rewriteKind == RK_None && getToolChain().IsObjCNonFragileABIDefault())); if (args.hasFlag(options::OPT_fobjc_nonfragile_abi, options::OPT_fno_objc_nonfragile_abi, nonFragileABIIsDefault)) { // Determine the non-fragile ABI version to use. #ifdef DISABLE_DEFAULT_NONFRAGILEABI_TWO unsigned nonFragileABIVersion = 1; #else unsigned nonFragileABIVersion = 2; #endif if (Arg *abiArg = args.getLastArg(options::OPT_fobjc_nonfragile_abi_version_EQ)) { StringRef value = abiArg->getValue(); if (value == "1") nonFragileABIVersion = 1; else if (value == "2") nonFragileABIVersion = 2; else getToolChain().getDriver().Diag(diag::err_drv_clang_unsupported) << value; } objcABIVersion = 1 + nonFragileABIVersion; } else { objcABIVersion = 1; } } // We don't actually care about the ABI version other than whether // it's non-fragile. bool isNonFragile = objcABIVersion != 1; // If we have no runtime argument, ask the toolchain for its default runtime. // However, the rewriter only really supports the Mac runtime, so assume that. ObjCRuntime runtime; if (!runtimeArg) { switch (rewriteKind) { case RK_None: runtime = getToolChain().getDefaultObjCRuntime(isNonFragile); break; case RK_Fragile: runtime = ObjCRuntime(ObjCRuntime::FragileMacOSX, VersionTuple()); break; case RK_NonFragile: runtime = ObjCRuntime(ObjCRuntime::MacOSX, VersionTuple()); break; } // -fnext-runtime } else if (runtimeArg->getOption().matches(options::OPT_fnext_runtime)) { // On Darwin, make this use the default behavior for the toolchain. if (getToolChain().getTriple().isOSDarwin()) { runtime = getToolChain().getDefaultObjCRuntime(isNonFragile); // Otherwise, build for a generic macosx port. } else { runtime = ObjCRuntime(ObjCRuntime::MacOSX, VersionTuple()); } // -fgnu-runtime } else { assert(runtimeArg->getOption().matches(options::OPT_fgnu_runtime)); // Legacy behaviour is to target the gnustep runtime if we are in // non-fragile mode or the GCC runtime in fragile mode. if (isNonFragile) runtime = ObjCRuntime(ObjCRuntime::GNUstep, VersionTuple(2, 0)); else runtime = ObjCRuntime(ObjCRuntime::GCC, VersionTuple()); } cmdArgs.push_back( args.MakeArgString("-fobjc-runtime=" + runtime.getAsString())); return runtime; } static bool maybeConsumeDash(const std::string &EH, size_t &I) { bool HaveDash = (I + 1 < EH.size() && EH[I + 1] == '-'); I += HaveDash; return !HaveDash; } namespace { struct EHFlags { bool Synch = false; bool Asynch = false; bool NoUnwindC = false; }; } // end anonymous namespace /// /EH controls whether to run destructor cleanups when exceptions are /// thrown. There are three modifiers: /// - s: Cleanup after "synchronous" exceptions, aka C++ exceptions. /// - a: Cleanup after "asynchronous" exceptions, aka structured exceptions. /// The 'a' modifier is unimplemented and fundamentally hard in LLVM IR. /// - c: Assume that extern "C" functions are implicitly nounwind. /// The default is /EHs-c-, meaning cleanups are disabled. static EHFlags parseClangCLEHFlags(const Driver &D, const ArgList &Args) { EHFlags EH; std::vector EHArgs = Args.getAllArgValues(options::OPT__SLASH_EH); for (auto EHVal : EHArgs) { for (size_t I = 0, E = EHVal.size(); I != E; ++I) { switch (EHVal[I]) { case 'a': EH.Asynch = maybeConsumeDash(EHVal, I); if (EH.Asynch) EH.Synch = false; continue; case 'c': EH.NoUnwindC = maybeConsumeDash(EHVal, I); continue; case 's': EH.Synch = maybeConsumeDash(EHVal, I); if (EH.Synch) EH.Asynch = false; continue; default: break; } D.Diag(clang::diag::err_drv_invalid_value) << "/EH" << EHVal; break; } } // The /GX, /GX- flags are only processed if there are not /EH flags. // The default is that /GX is not specified. if (EHArgs.empty() && Args.hasFlag(options::OPT__SLASH_GX, options::OPT__SLASH_GX_, /*default=*/false)) { EH.Synch = true; EH.NoUnwindC = true; } return EH; } void Clang::AddClangCLArgs(const ArgList &Args, types::ID InputType, ArgStringList &CmdArgs, codegenoptions::DebugInfoKind *DebugInfoKind, bool *EmitCodeView) const { unsigned RTOptionID = options::OPT__SLASH_MT; if (Args.hasArg(options::OPT__SLASH_LDd)) // The /LDd option implies /MTd. The dependent lib part can be overridden, // but defining _DEBUG is sticky. RTOptionID = options::OPT__SLASH_MTd; if (Arg *A = Args.getLastArg(options::OPT__SLASH_M_Group)) RTOptionID = A->getOption().getID(); StringRef FlagForCRT; switch (RTOptionID) { case options::OPT__SLASH_MD: if (Args.hasArg(options::OPT__SLASH_LDd)) CmdArgs.push_back("-D_DEBUG"); CmdArgs.push_back("-D_MT"); CmdArgs.push_back("-D_DLL"); FlagForCRT = "--dependent-lib=msvcrt"; break; case options::OPT__SLASH_MDd: CmdArgs.push_back("-D_DEBUG"); CmdArgs.push_back("-D_MT"); CmdArgs.push_back("-D_DLL"); FlagForCRT = "--dependent-lib=msvcrtd"; break; case options::OPT__SLASH_MT: if (Args.hasArg(options::OPT__SLASH_LDd)) CmdArgs.push_back("-D_DEBUG"); CmdArgs.push_back("-D_MT"); CmdArgs.push_back("-flto-visibility-public-std"); FlagForCRT = "--dependent-lib=libcmt"; break; case options::OPT__SLASH_MTd: CmdArgs.push_back("-D_DEBUG"); CmdArgs.push_back("-D_MT"); CmdArgs.push_back("-flto-visibility-public-std"); FlagForCRT = "--dependent-lib=libcmtd"; break; default: llvm_unreachable("Unexpected option ID."); } if (Args.hasArg(options::OPT__SLASH_Zl)) { CmdArgs.push_back("-D_VC_NODEFAULTLIB"); } else { CmdArgs.push_back(FlagForCRT.data()); // This provides POSIX compatibility (maps 'open' to '_open'), which most // users want. The /Za flag to cl.exe turns this off, but it's not // implemented in clang. CmdArgs.push_back("--dependent-lib=oldnames"); } if (Arg *A = Args.getLastArg(options::OPT_show_includes)) A->render(Args, CmdArgs); // This controls whether or not we emit RTTI data for polymorphic types. if (Args.hasFlag(options::OPT__SLASH_GR_, options::OPT__SLASH_GR, /*default=*/false)) CmdArgs.push_back("-fno-rtti-data"); // This controls whether or not we emit stack-protector instrumentation. // In MSVC, Buffer Security Check (/GS) is on by default. if (Args.hasFlag(options::OPT__SLASH_GS, options::OPT__SLASH_GS_, /*default=*/true)) { CmdArgs.push_back("-stack-protector"); CmdArgs.push_back(Args.MakeArgString(Twine(LangOptions::SSPStrong))); } // Emit CodeView if -Z7, -Zd, or -gline-tables-only are present. if (Arg *DebugInfoArg = Args.getLastArg(options::OPT__SLASH_Z7, options::OPT__SLASH_Zd, options::OPT_gline_tables_only)) { *EmitCodeView = true; if (DebugInfoArg->getOption().matches(options::OPT__SLASH_Z7)) *DebugInfoKind = codegenoptions::LimitedDebugInfo; else *DebugInfoKind = codegenoptions::DebugLineTablesOnly; CmdArgs.push_back("-gcodeview"); } else { *EmitCodeView = false; } const Driver &D = getToolChain().getDriver(); EHFlags EH = parseClangCLEHFlags(D, Args); if (EH.Synch || EH.Asynch) { if (types::isCXX(InputType)) CmdArgs.push_back("-fcxx-exceptions"); CmdArgs.push_back("-fexceptions"); } if (types::isCXX(InputType) && EH.Synch && EH.NoUnwindC) CmdArgs.push_back("-fexternc-nounwind"); // /EP should expand to -E -P. if (Args.hasArg(options::OPT__SLASH_EP)) { CmdArgs.push_back("-E"); CmdArgs.push_back("-P"); } unsigned VolatileOptionID; if (getToolChain().getArch() == llvm::Triple::x86_64 || getToolChain().getArch() == llvm::Triple::x86) VolatileOptionID = options::OPT__SLASH_volatile_ms; else VolatileOptionID = options::OPT__SLASH_volatile_iso; if (Arg *A = Args.getLastArg(options::OPT__SLASH_volatile_Group)) VolatileOptionID = A->getOption().getID(); if (VolatileOptionID == options::OPT__SLASH_volatile_ms) CmdArgs.push_back("-fms-volatile"); Arg *MostGeneralArg = Args.getLastArg(options::OPT__SLASH_vmg); Arg *BestCaseArg = Args.getLastArg(options::OPT__SLASH_vmb); if (MostGeneralArg && BestCaseArg) D.Diag(clang::diag::err_drv_argument_not_allowed_with) << MostGeneralArg->getAsString(Args) << BestCaseArg->getAsString(Args); if (MostGeneralArg) { Arg *SingleArg = Args.getLastArg(options::OPT__SLASH_vms); Arg *MultipleArg = Args.getLastArg(options::OPT__SLASH_vmm); Arg *VirtualArg = Args.getLastArg(options::OPT__SLASH_vmv); Arg *FirstConflict = SingleArg ? SingleArg : MultipleArg; Arg *SecondConflict = VirtualArg ? VirtualArg : MultipleArg; if (FirstConflict && SecondConflict && FirstConflict != SecondConflict) D.Diag(clang::diag::err_drv_argument_not_allowed_with) << FirstConflict->getAsString(Args) << SecondConflict->getAsString(Args); if (SingleArg) CmdArgs.push_back("-fms-memptr-rep=single"); else if (MultipleArg) CmdArgs.push_back("-fms-memptr-rep=multiple"); else CmdArgs.push_back("-fms-memptr-rep=virtual"); } // Parse the default calling convention options. if (Arg *CCArg = Args.getLastArg(options::OPT__SLASH_Gd, options::OPT__SLASH_Gr, options::OPT__SLASH_Gz, options::OPT__SLASH_Gv, options::OPT__SLASH_Gregcall)) { unsigned DCCOptId = CCArg->getOption().getID(); const char *DCCFlag = nullptr; bool ArchSupported = true; llvm::Triple::ArchType Arch = getToolChain().getArch(); switch (DCCOptId) { case options::OPT__SLASH_Gd: DCCFlag = "-fdefault-calling-conv=cdecl"; break; case options::OPT__SLASH_Gr: ArchSupported = Arch == llvm::Triple::x86; DCCFlag = "-fdefault-calling-conv=fastcall"; break; case options::OPT__SLASH_Gz: ArchSupported = Arch == llvm::Triple::x86; DCCFlag = "-fdefault-calling-conv=stdcall"; break; case options::OPT__SLASH_Gv: ArchSupported = Arch == llvm::Triple::x86 || Arch == llvm::Triple::x86_64; DCCFlag = "-fdefault-calling-conv=vectorcall"; break; case options::OPT__SLASH_Gregcall: ArchSupported = Arch == llvm::Triple::x86 || Arch == llvm::Triple::x86_64; DCCFlag = "-fdefault-calling-conv=regcall"; break; } // MSVC doesn't warn if /Gr or /Gz is used on x64, so we don't either. if (ArchSupported && DCCFlag) CmdArgs.push_back(DCCFlag); } if (Arg *A = Args.getLastArg(options::OPT_vtordisp_mode_EQ)) A->render(Args, CmdArgs); if (!Args.hasArg(options::OPT_fdiagnostics_format_EQ)) { CmdArgs.push_back("-fdiagnostics-format"); if (Args.hasArg(options::OPT__SLASH_fallback)) CmdArgs.push_back("msvc-fallback"); else CmdArgs.push_back("msvc"); } if (Args.hasArg(options::OPT__SLASH_Guard) && Args.getLastArgValue(options::OPT__SLASH_Guard).equals_lower("cf")) CmdArgs.push_back("-cfguard"); } visualstudio::Compiler *Clang::getCLFallback() const { if (!CLFallback) CLFallback.reset(new visualstudio::Compiler(getToolChain())); return CLFallback.get(); } const char *Clang::getBaseInputName(const ArgList &Args, const InputInfo &Input) { return Args.MakeArgString(llvm::sys::path::filename(Input.getBaseInput())); } const char *Clang::getBaseInputStem(const ArgList &Args, const InputInfoList &Inputs) { const char *Str = getBaseInputName(Args, Inputs[0]); if (const char *End = strrchr(Str, '.')) return Args.MakeArgString(std::string(Str, End)); return Str; } const char *Clang::getDependencyFileName(const ArgList &Args, const InputInfoList &Inputs) { // FIXME: Think about this more. std::string Res; if (Arg *OutputOpt = Args.getLastArg(options::OPT_o)) { std::string Str(OutputOpt->getValue()); Res = Str.substr(0, Str.rfind('.')); } else { Res = getBaseInputStem(Args, Inputs); } return Args.MakeArgString(Res + ".d"); } // Begin ClangAs void ClangAs::AddMIPSTargetArgs(const ArgList &Args, ArgStringList &CmdArgs) const { StringRef CPUName; StringRef ABIName; const llvm::Triple &Triple = getToolChain().getTriple(); mips::getMipsCPUAndABI(Args, Triple, CPUName, ABIName); CmdArgs.push_back("-target-abi"); CmdArgs.push_back(ABIName.data()); } void ClangAs::AddX86TargetArgs(const ArgList &Args, ArgStringList &CmdArgs) const { if (Arg *A = Args.getLastArg(options::OPT_masm_EQ)) { StringRef Value = A->getValue(); if (Value == "intel" || Value == "att") { CmdArgs.push_back("-mllvm"); CmdArgs.push_back(Args.MakeArgString("-x86-asm-syntax=" + Value)); } else { getToolChain().getDriver().Diag(diag::err_drv_unsupported_option_argument) << A->getOption().getName() << Value; } } } void ClangAs::ConstructJob(Compilation &C, const JobAction &JA, const InputInfo &Output, const InputInfoList &Inputs, const ArgList &Args, const char *LinkingOutput) const { ArgStringList CmdArgs; assert(Inputs.size() == 1 && "Unexpected number of inputs."); const InputInfo &Input = Inputs[0]; const llvm::Triple &Triple = getToolChain().getEffectiveTriple(); const std::string &TripleStr = Triple.getTriple(); const auto &D = getToolChain().getDriver(); // Don't warn about "clang -w -c foo.s" Args.ClaimAllArgs(options::OPT_w); // and "clang -emit-llvm -c foo.s" Args.ClaimAllArgs(options::OPT_emit_llvm); claimNoWarnArgs(Args); // Invoke ourselves in -cc1as mode. // // FIXME: Implement custom jobs for internal actions. CmdArgs.push_back("-cc1as"); // Add the "effective" target triple. CmdArgs.push_back("-triple"); CmdArgs.push_back(Args.MakeArgString(TripleStr)); // Set the output mode, we currently only expect to be used as a real // assembler. CmdArgs.push_back("-filetype"); CmdArgs.push_back("obj"); // Set the main file name, so that debug info works even with // -save-temps or preprocessed assembly. CmdArgs.push_back("-main-file-name"); CmdArgs.push_back(Clang::getBaseInputName(Args, Input)); // Add the target cpu std::string CPU = getCPUName(Args, Triple, /*FromAs*/ true); if (!CPU.empty()) { CmdArgs.push_back("-target-cpu"); CmdArgs.push_back(Args.MakeArgString(CPU)); } // Add the target features getTargetFeatures(getToolChain(), Triple, Args, CmdArgs, true); // Ignore explicit -force_cpusubtype_ALL option. (void)Args.hasArg(options::OPT_force__cpusubtype__ALL); // Pass along any -I options so we get proper .include search paths. Args.AddAllArgs(CmdArgs, options::OPT_I_Group); // Determine the original source input. const Action *SourceAction = &JA; while (SourceAction->getKind() != Action::InputClass) { assert(!SourceAction->getInputs().empty() && "unexpected root action!"); SourceAction = SourceAction->getInputs()[0]; } // Forward -g and handle debug info related flags, assuming we are dealing // with an actual assembly file. bool WantDebug = false; unsigned DwarfVersion = 0; Args.ClaimAllArgs(options::OPT_g_Group); if (Arg *A = Args.getLastArg(options::OPT_g_Group)) { WantDebug = !A->getOption().matches(options::OPT_g0) && !A->getOption().matches(options::OPT_ggdb0); if (WantDebug) DwarfVersion = DwarfVersionNum(A->getSpelling()); } if (DwarfVersion == 0) DwarfVersion = getToolChain().GetDefaultDwarfVersion(); codegenoptions::DebugInfoKind DebugInfoKind = codegenoptions::NoDebugInfo; if (SourceAction->getType() == types::TY_Asm || SourceAction->getType() == types::TY_PP_Asm) { // You might think that it would be ok to set DebugInfoKind outside of // the guard for source type, however there is a test which asserts // that some assembler invocation receives no -debug-info-kind, // and it's not clear whether that test is just overly restrictive. DebugInfoKind = (WantDebug ? codegenoptions::LimitedDebugInfo : codegenoptions::NoDebugInfo); // Add the -fdebug-compilation-dir flag if needed. addDebugCompDirArg(Args, CmdArgs); addDebugPrefixMapArg(getToolChain().getDriver(), Args, CmdArgs); // Set the AT_producer to the clang version when using the integrated // assembler on assembly source files. CmdArgs.push_back("-dwarf-debug-producer"); CmdArgs.push_back(Args.MakeArgString(getClangFullVersion())); // And pass along -I options Args.AddAllArgs(CmdArgs, options::OPT_I); } RenderDebugEnablingArgs(Args, CmdArgs, DebugInfoKind, DwarfVersion, llvm::DebuggerKind::Default); RenderDebugInfoCompressionArgs(Args, CmdArgs, D, getToolChain()); // Handle -fPIC et al -- the relocation-model affects the assembler // for some targets. llvm::Reloc::Model RelocationModel; unsigned PICLevel; bool IsPIE; std::tie(RelocationModel, PICLevel, IsPIE) = ParsePICArgs(getToolChain(), Args); const char *RMName = RelocationModelName(RelocationModel); if (RMName) { CmdArgs.push_back("-mrelocation-model"); CmdArgs.push_back(RMName); } // Optionally embed the -cc1as level arguments into the debug info, for build // analysis. if (getToolChain().UseDwarfDebugFlags()) { ArgStringList OriginalArgs; for (const auto &Arg : Args) Arg->render(Args, OriginalArgs); SmallString<256> Flags; const char *Exec = getToolChain().getDriver().getClangProgramPath(); Flags += Exec; for (const char *OriginalArg : OriginalArgs) { SmallString<128> EscapedArg; EscapeSpacesAndBackslashes(OriginalArg, EscapedArg); Flags += " "; Flags += EscapedArg; } CmdArgs.push_back("-dwarf-debug-flags"); CmdArgs.push_back(Args.MakeArgString(Flags)); } // FIXME: Add -static support, once we have it. // Add target specific flags. switch (getToolChain().getArch()) { default: break; case llvm::Triple::mips: case llvm::Triple::mipsel: case llvm::Triple::mips64: case llvm::Triple::mips64el: AddMIPSTargetArgs(Args, CmdArgs); break; case llvm::Triple::x86: case llvm::Triple::x86_64: AddX86TargetArgs(Args, CmdArgs); break; case llvm::Triple::arm: case llvm::Triple::armeb: case llvm::Triple::thumb: case llvm::Triple::thumbeb: // This isn't in AddARMTargetArgs because we want to do this for assembly // only, not C/C++. if (Args.hasFlag(options::OPT_mdefault_build_attributes, options::OPT_mno_default_build_attributes, true)) { CmdArgs.push_back("-mllvm"); CmdArgs.push_back("-arm-add-build-attributes"); } break; } // Consume all the warning flags. Usually this would be handled more // gracefully by -cc1 (warning about unknown warning flags, etc) but -cc1as // doesn't handle that so rather than warning about unused flags that are // actually used, we'll lie by omission instead. // FIXME: Stop lying and consume only the appropriate driver flags Args.ClaimAllArgs(options::OPT_W_Group); CollectArgsForIntegratedAssembler(C, Args, CmdArgs, getToolChain().getDriver()); Args.AddAllArgs(CmdArgs, options::OPT_mllvm); assert(Output.isFilename() && "Unexpected lipo output."); CmdArgs.push_back("-o"); CmdArgs.push_back(Output.getFilename()); if (Args.hasArg(options::OPT_gsplit_dwarf) && getToolChain().getTriple().isOSLinux()) { CmdArgs.push_back("-split-dwarf-file"); CmdArgs.push_back(SplitDebugName(Args, Input)); } assert(Input.isFilename() && "Invalid input."); CmdArgs.push_back(Input.getFilename()); const char *Exec = getToolChain().getDriver().getClangProgramPath(); C.addCommand(llvm::make_unique(JA, *this, Exec, CmdArgs, Inputs)); } // Begin OffloadBundler void OffloadBundler::ConstructJob(Compilation &C, const JobAction &JA, const InputInfo &Output, const InputInfoList &Inputs, const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const { // The version with only one output is expected to refer to a bundling job. assert(isa(JA) && "Expecting bundling job!"); // The bundling command looks like this: // clang-offload-bundler -type=bc // -targets=host-triple,openmp-triple1,openmp-triple2 // -outputs=input_file // -inputs=unbundle_file_host,unbundle_file_tgt1,unbundle_file_tgt2" ArgStringList CmdArgs; // Get the type. CmdArgs.push_back(TCArgs.MakeArgString( Twine("-type=") + types::getTypeTempSuffix(Output.getType()))); assert(JA.getInputs().size() == Inputs.size() && "Not have inputs for all dependence actions??"); // Get the targets. SmallString<128> Triples; Triples += "-targets="; for (unsigned I = 0; I < Inputs.size(); ++I) { if (I) Triples += ','; // Find ToolChain for this input. Action::OffloadKind CurKind = Action::OFK_Host; const ToolChain *CurTC = &getToolChain(); const Action *CurDep = JA.getInputs()[I]; if (const auto *OA = dyn_cast(CurDep)) { CurTC = nullptr; OA->doOnEachDependence([&](Action *A, const ToolChain *TC, const char *) { assert(CurTC == nullptr && "Expected one dependence!"); CurKind = A->getOffloadingDeviceKind(); CurTC = TC; }); } Triples += Action::GetOffloadKindName(CurKind); Triples += '-'; Triples += CurTC->getTriple().normalize(); if (CurKind == Action::OFK_HIP && CurDep->getOffloadingArch()) { Triples += '-'; Triples += CurDep->getOffloadingArch(); } } CmdArgs.push_back(TCArgs.MakeArgString(Triples)); // Get bundled file command. CmdArgs.push_back( TCArgs.MakeArgString(Twine("-outputs=") + Output.getFilename())); // Get unbundled files command. SmallString<128> UB; UB += "-inputs="; for (unsigned I = 0; I < Inputs.size(); ++I) { if (I) UB += ','; // Find ToolChain for this input. const ToolChain *CurTC = &getToolChain(); if (const auto *OA = dyn_cast(JA.getInputs()[I])) { CurTC = nullptr; OA->doOnEachDependence([&](Action *, const ToolChain *TC, const char *) { assert(CurTC == nullptr && "Expected one dependence!"); CurTC = TC; }); } UB += CurTC->getInputFilename(Inputs[I]); } CmdArgs.push_back(TCArgs.MakeArgString(UB)); // All the inputs are encoded as commands. C.addCommand(llvm::make_unique( JA, *this, TCArgs.MakeArgString(getToolChain().GetProgramPath(getShortName())), CmdArgs, None)); } void OffloadBundler::ConstructJobMultipleOutputs( Compilation &C, const JobAction &JA, const InputInfoList &Outputs, const InputInfoList &Inputs, const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const { // The version with multiple outputs is expected to refer to a unbundling job. auto &UA = cast(JA); // The unbundling command looks like this: // clang-offload-bundler -type=bc // -targets=host-triple,openmp-triple1,openmp-triple2 // -inputs=input_file // -outputs=unbundle_file_host,unbundle_file_tgt1,unbundle_file_tgt2" // -unbundle ArgStringList CmdArgs; assert(Inputs.size() == 1 && "Expecting to unbundle a single file!"); InputInfo Input = Inputs.front(); // Get the type. CmdArgs.push_back(TCArgs.MakeArgString( Twine("-type=") + types::getTypeTempSuffix(Input.getType()))); // Get the targets. SmallString<128> Triples; Triples += "-targets="; auto DepInfo = UA.getDependentActionsInfo(); for (unsigned I = 0; I < DepInfo.size(); ++I) { if (I) Triples += ','; auto &Dep = DepInfo[I]; Triples += Action::GetOffloadKindName(Dep.DependentOffloadKind); Triples += '-'; Triples += Dep.DependentToolChain->getTriple().normalize(); if (Dep.DependentOffloadKind == Action::OFK_HIP && !Dep.DependentBoundArch.empty()) { Triples += '-'; Triples += Dep.DependentBoundArch; } } CmdArgs.push_back(TCArgs.MakeArgString(Triples)); // Get bundled file command. CmdArgs.push_back( TCArgs.MakeArgString(Twine("-inputs=") + Input.getFilename())); // Get unbundled files command. SmallString<128> UB; UB += "-outputs="; for (unsigned I = 0; I < Outputs.size(); ++I) { if (I) UB += ','; UB += DepInfo[I].DependentToolChain->getInputFilename(Outputs[I]); } CmdArgs.push_back(TCArgs.MakeArgString(UB)); CmdArgs.push_back("-unbundle"); // All the inputs are encoded as commands. C.addCommand(llvm::make_unique( JA, *this, TCArgs.MakeArgString(getToolChain().GetProgramPath(getShortName())), CmdArgs, None)); }