CppDepend Diagnostics

Clang diagnostics

CppDepend operates all Clang diagnostics which are easy to browse using CQlinq. The following CQLinq query matches all Clang diagnostics:

warnif count >0
from issue in Issues where issue.ToolName=="Clang"
select new
{ issue, issue.Type, issue.FilePath, issue.BeginLine }

The diagnostics could be filtred by their types and here is the list of all Clang warnings and their associated description:


Diagnostic type


warn_pp_ambiguous_macro "ambiguous expansion of macro %0"
backslash_newline_space "backslash and newline separated by space"
warn_nested_block_comment "'/*' within block comment"
escaped_newline_block_comment_end "escaped newline between */ characters at block comment end"
pp_disabled_macro_expansion "disabled expansion of recursive macro"
warn_header_guard "%0 is used as a header guard here, followed by #define of a different macro"
warn_mmap_unknown_attribute "unknown attribute '%0'"
warn_no_newline_eof "no newline at end of file"
null_in_file "null character ignored"
null_in_char "null character(s) preserved in character literal"
null_in_string "null character(s) preserved in string literal"
trigraph_ignored_block_comment "ignored trigraph would end block comment"
trigraph_ignored "trigraph ignored"
warn_pp_undef_identifier "%0 is not defined, evaluates to 0"
warn_ucn_escape_surrogate "universal character name refers to a surrogate character"
warn_ucn_not_valid_in_c89 "universal character names are only valid in C99 or C++ treating as '\' followed by identifier"
warn_ucn_escape_no_digits "\%0 used with no following hex digits treating as '\' followed by identifier"
pp_macro_not_used "macro is not used"


Warning Flag


warn_auto_storage_class "'auto' storage class specifier is redundant and incompatible with C++11"
warn_deprecated_register "'register' storage class specifier is deprecated"
warn_extra_semi_after_mem_fn_def "extra '' after member function definition"
warn_omp_extra_tokens_at_eol "extra tokens at the end of '#pragma omp %0' are ignored"
warn_duplicate_declspec "duplicate '%0' declaration specifier"
warn_dangling_else "add explicit braces to avoid dangling else"
warn_attribute_no_decl "attribute %0 ignored, because it is not attached to a declaration"
warn_microsoft_dependent_exists "dependent %select{__if_not_exists|__if_exists}0 declarations are ignored"
warn_semicolon_before_method_body "semicolon before method body is ignored"
warn_pragma_omp_ignored "unexpected '#pragma omp ...' in program"
warn_static_inline_explicit_inst_ignored "ignoring '%select{static


Warning Flag


warn_abstract_vbase_init "initializer for virtual base class %0 of abstract class %1 will never be used"
warn_temporary_array_to_pointer_decay "pointer is initialized by a temporary array, which will be destroyed at the end of the full_expression"
warn_ptr_arith_precedes_bounds "the pointer decremented by %0 refers before the beginning of the array"
warn_ptr_arith_exceeds_bounds "the pointer incremented by %0 refers past the end of the array (that contains %1 element%s2)"
warn_typecheck_zero_static_array_size "'static' has no effect on zero_length arrays"
warn_static_array_too_small "array argument is too small contains %0 elements, callee requires at least %1"
warn_array_index_precedes_bounds "array index %0 is before the beginning of the array"
warn_array_index_exceeds_bounds "array index %0 is past the end of the array (which contains %1 element%s2)"
warn_not_in_enum_assignment "integer constant not in range of enumerated type %0"
warn_atomic_property_rule "writable atomic property %0 cannot pair a synthesized %select{getter
warn_unknown_attribute_ignored "unknown attribute %0 ignored"
warn_auto_var_is_id "'auto' deduced as 'id' in declaration of %0"
warn_mismatched_availability "availability does not match previous declaration"
warn_mismatched_availability_override_unavail "overriding method cannot be unavailable on %0 when its overridden method is available"
warn_bad_function_cast "cast from function call of type %0 to non_matching type %1"
warn_impcast_bitfield_precision_constant "implicit truncation from %2 to bitfield changes value from %0 to %1"
warn_impcast_bool_to_null_pointer "initialization of pointer of type %0 to null from a constant boolean " "expression"
warn_implicit_decl_requires_sysheader "declaration of built-in function '%1' requires inclusion of the header %0"
warn_explicit_instantiation_inline_0x "explicit instantiation cannot be 'inline'"
warn_explicit_instantiation_must_be_global_0x "explicit instantiation of %0 must occur at global scope"
warn_explicit_instantiation_out_of_scope_0x "explicit instantiation of %0 not in a namespace enclosing %1"
warn_explicit_instantiation_unqualified_wrong_namespace_0x "explicit instantiation of %q0 must occur in namespace %1"
warn_init_list_constant_narrowing "constant expression evaluates to %0 which cannot be narrowed to type %1 in C++11"
warn_init_list_variable_narrowing "non_constant_expression cannot be narrowed from type %0 to %1 in initializer list in C++11"
warn_init_list_type_narrowing "type %0 cannot be narrowed to %1 in initializer list in C++11"
warn_cast_align "cast from %0 to %1 increases required alignment from %2 to %3"
warn_subscript_is_char "array subscript is of type 'char'"
warn_logical_instead_of_bitwise "use of logical '%0' with constant operand"
warn_impcast_complex_scalar "implicit conversion discards imaginary component: %0 to %1"
warn_impcast_float_precision "implicit conversion loses floating_point precision: %0 to %1"
warn_impcast_integer_precision "implicit conversion loses integer precision: %0 to %1"
warn_impcast_floating_point_to_bool "implicit conversion turns floating_point number into integer: %0 to %1"
warn_impcast_vector_scalar "implicit conversion turns vector to scalar: %0 to %1"
warn_template_arg_negative "non_type template argument with value '%0' converted to '%1' for unsigned template parameter of type %2"
warn_unreachable_default "default label in switch which covers all enumeration values"
warn_default_atomic_custom_getter_setter "atomic by default property %0 has a user defined %select{getter
warn_bind_ref_member_to_temporary "binding reference %select{|subobject of }1member %0 to a temporary value"
warn_bind_ref_member_to_parameter "binding reference member %0 to stack allocated parameter %1"
warn_init_ptr_member_to_parameter_addr "initializing pointer member %0 with the stack address of parameter %1"
warn_dangling_std_initializer_list "array backing the initializer list will be destroyed at the end of %select{the full_expression
warn_delete_incomplete "deleting pointer to incomplete type %0 may cause undefined behavior"
warn_delete_non_virtual_dtor "delete called on %0 that has virtual functions but non_virtual destructor"
warn_delete_abstract_non_virtual_dtor "delete called on %0 that is abstract but has non_virtual destructor"
warn_increment_bool "incrementing expression of type bool is deprecated"
warn_access_decl_deprecated "access declarations are deprecated use using declarations instead"
warn_deprecated_copy_operation "definition of implicit copy {constructor|assignment operator} for %0 is deprecated because it has a user-declared"
warn_exception_spec_deprecated "dynamic exception specifications are deprecated"
warn_division_by_zero "division by zero is undefined"
warn_remainder_by_zero "remainder by zero is undefined"
warn_duplicate_enum_values "element %0 has been implicitly assigned %1 which another element has been assigned"
warn_duplicate_method_decl "multiple declarations of method %0 found and ignored"
warn_empty_for_body "for loop has empty body"
warn_empty_if_body "if statement has empty body"
warn_empty_range_based_for_body "range_based for loop has empty body"
warn_empty_switch_body "switch statement has empty body"
warn_empty_while_body "while loop has empty body"
warn_comparison_of_mixed_enum_types "comparison of two values with different enumeration types%diff{ ($ and $)
warn_impcast_different_enum_types "implicit conversion from enumeration type %0 to different enumeration type %1"
warn_exit_time_destructor "declaration requires an exit_time destructor"
warn_arc_strong_pointer_objc_pointer "method parameter of type %0 with no explicit ownership"
warn_extern_init "'extern' variable has an initializer"
warn_floatingpoint_eq "comparing floating point with == or != is unsafe"
warn_printf_data_arg_not_used "data argument not used by format string"
warn_format_invalid_conversion "invalid conversion specifier '%0'"
warn_format_nonliteral "format string is not a string literal"
warn_format_nonliteral_noargs "format string is not a string literal (potentially insecure)"
warn_empty_format_string "format string is empty"
warn_format_conversion_argument_type_mismatch "format specifies type %0 but the argument has type %1"
warn_printf_format_string_contains_null_char "format string contains '\0' within the string body"
warn_missing_format_string "format string missing"
warn_format_string_is_wide_literal "format string should not be a wide string"
warn_printf_incomplete_specifier "incomplete format specifier"
warn_format_invalid_positional_specifier "invalid position specified for %select{field width
warn_format_nonsensical_length "length modifier '%0' results in undefined behavior or no effect with '%1' conversion specifier"
warn_printf_insufficient_data_args "more '%%' conversions than data arguments"
warn_scanf_scanlist_incomplete "no closing ']' for '%%[' in scanf format string"
warn_format_zero_positional_specifier "position arguments in format strings start counting at 1 (not 0)"
warn_scanf_nonzero_width "zero field width in scanf format string is unused"
warn_global_constructor "declaration requires a global constructor"
warn_global_destructor "declaration requires a global destructor"
warn_using_directive_in_header "using namespace directive in global context in header"
warn_implicit_function_decl "implicit declaration of function %0"
warn_builtin_unknown "use of unknown builtin %0"
warn_undef_method_impl "method definition for %0 not found"
warn_using_decl_constructor_ellipsis "inheriting constructor does not inherit ellipsis"
warn_initializer_overrides "initializer overrides prior initialization of this subobject"
warn_subobject_initializer_overrides "subobject initialization overrides initialization of other fields within its enclosing subobject"
warn_int_to_pointer_cast "cast to %1 from smaller integer type %0"
warn_int_to_void_pointer_cast "cast to %1 from smaller integer type %0"
warn_noreturn_function_has_return_expr "function declared 'noreturn' should not return"
warn_parameter_size "%0 is a large (%1 bytes) pass_by_value argument pass it by reference instead ?"
warn_return_value_size "return value of %0 is a large (%1 bytes) pass_by_value object pass it by reference instead ?"
warn_impcast_literal_float_to_integer "implicit conversion from %0 to %1 changes value from %2 to %3"
warn_float_overflow "magnitude of floating_point constant too large for type %0 maximum is %1"
warn_float_underflow "magnitude of floating_point constant too small for type %0 minimum is %1"
warn_conflicting_param_types "conflicting parameter types in implementation of %0: %1 vs %2"
warn_conflicting_ret_types "conflicting return type in implementation of %0: %1 vs %2"
warn_namespace_member_extra_qualification "extra qualification on member %0"
warn_missing_braces "suggest braces around initialization of subobject"
warn_missing_field_initializers "missing field '%0' initializer"
warn_missing_method_return_type "method has no return type specified defaults to 'id'"
warn_missing_variable_declarations "no previous extern declaration for non_static variable %0"
warn_vbase_moved_multiple_times "defaulted move assignment operator of %0 will move assign virtual base class %1 multiple times"
warn_non_literal_null_pointer "expression which evaluates to zero treated as a null pointer constant of " "type %0"
warn_non_pod_vararg_with_format_string "cannot pass %select{non-POD|non-trivial}0 object of type %1 to variadic"
warn_cannot_pass_non_pod_arg_to_vararg "cannot pass object of %select{non-POD|non-trivial}0 type %1 through variadic"
warn_non_virtual_dtor "%0 has virtual functions but non_virtual destructor"
warn_null_arg "null passed to a callee that requires a non-null argument"
warn_null_in_comparison_operation "comparison between NULL and non_pointer %select{(%1 and NULL)
warn_null_in_arithmetic_operation "use of NULL in arithmetic operation"
warn_indirection_through_null "indirection of non_volatile null pointer will be deleted, not trap"
warn_overaligned_type "type %0 requires %1 bytes of alignment and the default allocator only guarantees %2 bytes"
warn_overloaded_virtual "%q0 hides overloaded virtual %select{function
warn_overriding_method_mismatch "conflicting parameter types in declaration of %0%diff{: $ vs $
warn_overriding_method_mismatch "conflicting parameter types in declaration of %0: %1 vs %2"
warn_overriding_method_mismatch "conflicting return type in declaration of %0%diff{: $ vs $
warn_overriding_method_mismatch "conflicting return type in declaration of %0: %1 vs %2"
warn_overriding_method_mismatch "conflicting variadic declaration of method and its implementation"
warn_packed "packed attribute is unnecessary for %0"
warn_padded "padding %select{struct
warn_padded "padding %select{struct
warn_padded "padding size of %0 with %1 %select{byte
warn_parentheses_equality "equality comparison with extraneous parentheses"
warn_parentheses "%0 has lower precedence than %1 %1 will be evaluated first"
warn_parentheses "operator '?:' has lower precedence than '%0' '%0' will be evaluated first"
warn_parentheses "using the result of an assignment as a condition without parentheses"
warn_pointer_arith "subtraction of pointers to type %0 of zero size has undefined behavior"
warn_predefined_identifier_outside_function "predefined identifier is only valid inside function"
warn_private_extern "use of private_extern on a declaration may not produce external symbol private to the linkage unit and is deprecated"
warn_protocol_property_synthesis_ambiguity "property of type %0 was selected for synthesis"
warn_protocol "method %0 in protocol not implemented"
warn_readonly_iboutlet_property "readonly IBOutlet property '%0' when auto_synthesized may not work correctly with 'nib' loader"
warn_readonly_setter_attrs "property attributes '%0' and '%1' are mutually exclusive"
warn_receiver_expr "receiver type %0 is not 'id' or interface pointer, consider casting it to 'id'"
warn_receiver_forward_class "receiver type %0 for instance message is a forward declaration"
warn_receiver_is_weak, DefaultIgnore "weak %select{receiver
warn_reinterpret_base_class "'reinterpret_cast' %select{from
warn_reorder "%select{field
warn_requires_super_attribute "%0 attribute cannot be applied to %select{methods in protocols
warn_return_stack_address "address of stack memory associated with local variable %0 returned"
warn_return_stack_address "reference to stack memory associated with local variable %0 returned"
warn_return_stack_address "returning address of label, which is local"
warn_return_stack_address "returning address of local temporary object"
warn_return_stack_address "returning reference to local temporary object"
warn_return_type_c_linkage "%0 has C_linkage specified, but returns incomplete type %1 which could be incompatible with C"
warn_return_type_c_linkage "%0 has C_linkage specified, but returns user_defined type %1 which is incompatible with C"
warn_return_type "control may reach end of non_void function"
warn_return_type "control reaches end of non_void function"
warn_return_type "non_void %select{function
warn_section "section does not match previous declaration"
warn_selector_type_mismatch "multiple selectors named %0 found"
warn_selector "creating selector for nonexistent method %0"
warn_self_assign_field "assigning %select{field
warn_self_assign "explicitly assigning a variable of type %0 to itself"
warn_sentinel "missing sentinel in %select{function call
warn_sentinel "not enough variable arguments in %0 declaration to fit a sentinel"
warn_shadow_ivar "local declaration of %0 hides instance variable"
warn_shadow "declaration shadows a %select{" "local variable
warn_shift_count_negative "shift count is negative"
warn_shift_count_overflow "shift count = width of type"
warn_shift_overflow "signed shift result (%0) requires %1 bits to represent, but %2 only has %3 bits"
warn_shift_sign_overflow, DefaultIgnore "signed shift result (%0) sets the sign bit of the shift expression's type (%1) and becomes negative"
warn_shorten_64_to_32 "implicit conversion loses integer precision: %0 to %1"
warn_sign_compare "comparison of integers of different signs: %0 and %1"
warn_sign_conversion "implicit conversion changes signedness: %0 to %1"
warn_sign_conversion "operand of ? changes signedness: %0 to %1"
warn_sizeof_array_argument "sizeof on array function parameter will return size of %0 instead of %1"
warn_sizeof_array_decay "sizeof on pointer operation will return size of %0 instead of %1"
warn_sizeof_pointer_memaccess "'%0' call operates on objects of type %1 while the size is based on a " "different type %2"
warn_sizeof_pointer_memaccess "argument to 'sizeof' in %0 call is the same pointer type %1 as the %select{destination
warn_sometimes_uninitialized "variable %0 is %select{used
warn_static_local_in_inline "non_constant static local variable in inline function may be different in different files"
warn_static_self_init "static variable %0 is suspiciously used within its own initialization"
warn_strict_selector_match "multiple methods named %0 found"
warn_string_compare "result of comparison against %select{a string literal
warn_string_conversion "implicit conversion turns string literal into bool: %0 to %1"
warn_string_plus_char "adding %0 to a string pointer does not append to the string"
warn_string_plus_int "adding %0 to a string does not append to the string"
warn_strlcpy_strlcat_size "size argument in %0 call appears to be size of the source expected the size of the destination"
warn_strncat_size "size argument in 'strncat' call appears " "to be size of the source"
warn_strncat_size "the value of the size argument in 'strncat' is too large, might lead to a " "buffer overflow"
warn_strncat_size "the value of the size argument to 'strncat' is wrong"
warn_super_class_method_mismatch "method parameter type %diff{$ does not match super class method parameter type $
warn_switch_enum "%0 enumeration values not explicitly handled in switch: %1, %2, %3..."
warn_switch_enum "enumeration value %0 not explicitly handled in switch"
warn_switch_enum "enumeration values %0 and %1 not explicitly handled in switch"
warn_switch_enum "enumeration values %0, %1, and %2 not explicitly handled in switch"
warn_switch "%0 enumeration values not handled in switch: %1, %2, %3..."
warn_switch "case value not in enumerated type %0"
warn_switch "enumeration value %0 not handled in switch"
warn_switch "enumeration values %0 and %1 not handled in switch"
warn_switch "enumeration values %0, %1, and %2 not handled in switch"
warn_switch "overflow converting case value to switch condition type (%0 to %1)"
warn_tautological_compare "%select{self_
warn_tautological_compare "comparison of %0 unsigned%select{
warn_tautological_compare "comparison of unsigned%select{
warn_tautological_constant_out_of_range_compare "comparison of constant %0 with expression of type %1 is always %select{false
warn_thread_safety_analysis "%select{reading
warn_thread_safety_analysis "%select{reading
warn_thread_safety_analysis "%select{reading
warn_thread_safety_analysis "%select{reading
warn_thread_safety_analysis "calling function '%0' requires %select{shared
warn_thread_safety_analysis "cannot call function '%0' while mutex '%1' is locked"
warn_thread_safety_analysis "cannot resolve lock expression"
warn_thread_safety_analysis "expecting mutex '%0' to be locked at start of each loop"
warn_thread_safety_analysis "expecting mutex '%0' to be locked at the end of function"
warn_thread_safety_analysis "locking '%0' that is already locked"
warn_thread_safety_analysis "mutex '%0' is locked exclusively and shared in the same scope"
warn_thread_safety_analysis "mutex '%0' is not locked on every path through here"
warn_thread_safety_analysis "mutex '%0' is still locked at the end of function"
warn_thread_safety_analysis "unlocking '%0' that was not locked"
warn_thread_safety_attributes "%0 attribute can only be applied in a context annotated with 'lockable' attribute"
warn_thread_safety_attributes "%0 attribute only applies to %select{fields and global variables
warn_thread_safety_attributes "%0 attribute requires arguments that are class type or point to class type type here is '%1'"
warn_thread_safety_attributes "%0 attribute requires arguments whose type is annotated with 'lockable' attribute type here is '%1'"
warn_thread_safety_attributes "'%0' only applies to pointer types type here is %1"
warn_thread_safety_attributes "ignoring %0 attribute because its argument is invalid"
warn_thread_safety_beta "Thread safety beta warning."
warn_thread_safety_precise "%select{reading
warn_thread_safety_precise "%select{reading
warn_thread_safety_precise "calling function '%0' requires %select{shared
warn_type_safety "argument type %0 doesn't match specified '%1' type tag %select{that requires %3
warn_type_safety "specified %0 type tag requires a null pointer"
warn_type_safety "this type tag was not designed to be used with this function"
warn_undeclared_selector "undeclared selector %0 did you mean %1?"
warn_undeclared_selector "undeclared selector %0"
warn_undefined_inline "inline function %q0 is not defined"
warn_undefined_internal "%select{function
warn_undefined_reinterpret_cast "dereference of type %1 that was reinterpret_cast from type %0 has undefined behavior"
warn_undefined_reinterpret_cast "reinterpret_cast from %0 to %1 has undefined behavior"
warn_uninitialized "block pointer variable %0 is uninitialized when captured by block"
warn_uninitialized "field %0 is uninitialized when used here"
warn_uninitialized "reference %0 is not yet bound to a value when used here"
warn_uninitialized "reference %0 is not yet bound to a value when used within its own initialization"
warn_uninitialized "variable %0 is uninitialized when %select{used here
warn_uninitialized "variable %0 is uninitialized when used within its own initialization"
warn_unneeded_internal_declaration "%select{function
warn_unneeded_internal_declaration "'static' function %0 declared in header file should be declared 'static inline'"
warn_unneeded_member_function "member function %0 is not needed and will not be emitted"
warn_unreachable_code, DefaultIgnore "will never be executed"
warn_unsequenced "multiple unsequenced modifications to %0"
warn_unsequenced "unsequenced modification and access to %0"
warn_unsupported_friend "dependent nested name specifier '%0' for friend class declaration is not supported turning off access control for %1"
warn_unsupported_friend "dependent nested name specifier '%0' for friend template declaration is not supported ignoring this friend declaration"
warn_unsupported_visibility "target does not support 'protected' visibility using 'default'"
warn_unused_comparison "%select{equality
warn_unused_const_variable "unused variable %0"
warn_unused_exception_parameter "unused exception parameter %0"
warn_unused_function "unused function %0"
warn_unused_label "unused label %0"
warn_unused_member_function "unused member function %0"
warn_unused_parameter "unused parameter %0"
warn_unused_private_field "private field %0 is not used"
warn_unused_property_ivar "ivar %0 which backs the property is not referenced in this property's accessor"
warn_unused_result "ignoring return value of function declared with warn_unused_result attribute"
warn_unused_value "expression result unused should this cast be to 'void'?"
warn_unused_value "expression result unused"
warn_unused_value "ignoring return value of function declared with %0 attribute"
warn_unused_variable "unused variable %0"
warn_unused_volatile_lvalue "expression result unused assign into a variable to force a volatile load"
warn_used_but_marked_unused "%0 was marked unused but was used"
warn_user_defined_literals "user_defined literal suffixes not starting with '_' are reserved%select{ no literal will invoke this operator
warn_varargs "'va_start' has undefined behavior with reference types"
warn_varargs "second argument to 'va_arg' is of promotable type %0 this va_arg has undefined behavior because arguments will be promoted to %1"
warn_varargs "second parameter of 'va_start' not last named argument"
warn_vector_conversion "incompatible vector types "%select{\%diff{assigning to $ from $
warn_vexing_parse "empty parentheses interpreted as a function declaration"
warn_vexing_parse "parentheses were disambiguated as a function declaration"
warn_visibility "declaration of %0 will not be visible outside of this function"
warn_visibility "redefinition of %0 will not be visible outside of this function"
warn_vla "variable length array used"
warn_weak_template_vtables "explicit template instantiation %0 will emit a vtable in every translation unit"
warn_weak_vtables "%0 has no out_of_line virtual method definitions its vtable will be emitted in every translation unit"