warning-flags.c revision 1691dc4a7aa6835d28e6c2217505e778b606c733
1RUN: diagtool list-warnings > %t 2>&1 2RUN: FileCheck --input-file=%t %s 3 4This test serves two purposes: 5 6(1) It documents all existing warnings that currently have no associated -W flag, 7 and ensures that the list never grows. 8 9 If take an existing warning and add a flag, this test will fail. To 10 fix this test, simply remove that warning from the list below. 11 12(2) It prevents us adding new warnings to Clang that have no -W flag. All 13 new warnings should have -W flags. 14 15 If you add a new warning without a flag, this test will fail. To fix 16 this test, simply add a warning group to that warning. 17 18 19The list of warnings below should NEVER grow. It should gradually shrink to 0. 20 21CHECK: Warnings without flags (134): 22CHECK-NEXT: ext_delete_void_ptr_operand 23CHECK-NEXT: ext_expected_semi_decl_list 24CHECK-NEXT: ext_explicit_specialization_storage_class 25CHECK-NEXT: ext_implicit_lib_function_decl 26CHECK-NEXT: ext_missing_declspec 27CHECK-NEXT: ext_missing_whitespace_after_macro_name 28CHECK-NEXT: ext_new_paren_array_nonconst 29CHECK-NEXT: ext_plain_complex 30CHECK-NEXT: ext_pp_macro_redef 31CHECK-NEXT: ext_template_arg_extra_parens 32CHECK-NEXT: ext_typecheck_comparison_of_pointer_integer 33CHECK-NEXT: ext_typecheck_cond_incompatible_operands 34CHECK-NEXT: ext_typecheck_cond_incompatible_operands_nonstandard 35CHECK-NEXT: ext_typecheck_ordered_comparison_of_function_pointers 36CHECK-NEXT: ext_typecheck_ordered_comparison_of_pointer_integer 37CHECK-NEXT: ext_unknown_escape 38CHECK-NEXT: ext_using_undefined_std 39CHECK-NEXT: pp_include_next_absolute_path 40CHECK-NEXT: pp_include_next_in_primary 41CHECK-NEXT: pp_invalid_string_literal 42CHECK-NEXT: pp_out_of_date_dependency 43CHECK-NEXT: pp_poisoning_existing_macro 44CHECK-NEXT: pp_pragma_once_in_main_file 45CHECK-NEXT: pp_pragma_sysheader_in_main_file 46CHECK-NEXT: w_asm_qualifier_ignored 47CHECK-NEXT: warn_accessor_property_type_mismatch 48CHECK-NEXT: warn_anon_bitfield_width_exceeds_type_size 49CHECK-NEXT: warn_asm_label_on_auto_decl 50CHECK-NEXT: warn_bitfield_width_exceeds_type_size 51CHECK-NEXT: warn_bool_switch_condition 52CHECK-NEXT: warn_braces_around_scalar_init 53CHECK-NEXT: warn_c_kext 54CHECK-NEXT: warn_call_to_pure_virtual_member_function_from_ctor_dtor 55CHECK-NEXT: warn_call_wrong_number_of_arguments 56CHECK-NEXT: warn_case_empty_range 57CHECK-NEXT: warn_char_constant_too_large 58CHECK-NEXT: warn_collection_expr_type 59CHECK-NEXT: warn_conflicting_variadic 60CHECK-NEXT: warn_conv_to_base_not_used 61CHECK-NEXT: warn_conv_to_self_not_used 62CHECK-NEXT: warn_conv_to_void_not_used 63CHECK-NEXT: warn_delete_array_type 64CHECK-NEXT: warn_double_const_requires_fp64 65CHECK-NEXT: warn_drv_assuming_mfloat_abi_is 66CHECK-NEXT: warn_drv_clang_unsupported 67CHECK-NEXT: warn_drv_objc_gc_unsupported 68CHECK-NEXT: warn_drv_pch_not_first_include 69CHECK-NEXT: warn_dup_category_def 70CHECK-NEXT: warn_duplicate_protocol_def 71CHECK-NEXT: warn_enum_too_large 72CHECK-NEXT: warn_enum_value_overflow 73CHECK-NEXT: warn_enumerator_too_large 74CHECK-NEXT: warn_exception_caught_by_earlier_handler 75CHECK-NEXT: warn_excess_initializers 76CHECK-NEXT: warn_excess_initializers_in_char_array_initializer 77CHECK-NEXT: warn_expected_qualified_after_typename 78CHECK-NEXT: warn_extraneous_char_constant 79CHECK-NEXT: warn_fe_cc_log_diagnostics_failure 80CHECK-NEXT: warn_fe_cc_print_header_failure 81CHECK-NEXT: warn_fe_macro_contains_embedded_newline 82CHECK-NEXT: warn_file_asm_volatile 83CHECK-NEXT: warn_ignoring_ftabstop_value 84CHECK-NEXT: warn_implements_nscopying 85CHECK-NEXT: warn_incompatible_qualified_id 86CHECK-NEXT: warn_initializer_string_for_char_array_too_long 87CHECK-NEXT: warn_inline_namespace_reopened_noninline 88CHECK-NEXT: warn_integer_too_large_for_signed 89CHECK-NEXT: warn_invalid_asm_cast_lvalue 90CHECK-NEXT: warn_many_braces_around_scalar_init 91CHECK-NEXT: warn_maynot_respond 92CHECK-NEXT: warn_method_param_redefinition 93CHECK-NEXT: warn_mismatched_exception_spec 94CHECK-NEXT: warn_missing_case_for_condition 95CHECK-NEXT: warn_missing_dependent_template_keyword 96CHECK-NEXT: warn_missing_exception_specification 97CHECK-NEXT: warn_missing_whitespace_after_macro_name 98CHECK-NEXT: warn_multiple_method_decl 99CHECK-NEXT: warn_no_constructor_for_refconst 100CHECK-NEXT: warn_nonnull_pointers_only 101CHECK-NEXT: warn_not_compound_assign 102CHECK-NEXT: warn_objc_property_copy_missing_on_block 103CHECK-NEXT: warn_objc_protocol_qualifier_missing_id 104CHECK-NEXT: warn_on_superclass_use 105CHECK-NEXT: warn_param_default_argument_redefinition 106CHECK-NEXT: warn_partial_specs_not_deducible 107CHECK-NEXT: warn_pp_convert_lhs_to_positive 108CHECK-NEXT: warn_pp_convert_rhs_to_positive 109CHECK-NEXT: warn_pp_expr_overflow 110CHECK-NEXT: warn_pp_line_decimal 111CHECK-NEXT: warn_pragma_align_expected_equal 112CHECK-NEXT: warn_pragma_align_invalid_option 113CHECK-NEXT: warn_pragma_debug_unexpected_command 114CHECK-NEXT: warn_pragma_expected_colon 115CHECK-NEXT: warn_pragma_expected_enable_disable 116CHECK-NEXT: warn_pragma_expected_identifier 117CHECK-NEXT: warn_pragma_expected_lparen 118CHECK-NEXT: warn_pragma_expected_rparen 119CHECK-NEXT: warn_pragma_extra_tokens_at_eol 120CHECK-NEXT: warn_pragma_ms_struct 121CHECK-NEXT: warn_pragma_options_align_reset_failed 122CHECK-NEXT: warn_pragma_options_expected_align 123CHECK-NEXT: warn_pragma_pack_invalid_action 124CHECK-NEXT: warn_pragma_pack_invalid_alignment 125CHECK-NEXT: warn_pragma_pack_malformed 126CHECK-NEXT: warn_pragma_pack_pop_failed 127CHECK-NEXT: warn_pragma_pack_pop_identifer_and_alignment 128CHECK-NEXT: warn_pragma_pack_show 129CHECK-NEXT: warn_pragma_pop_macro_no_push 130CHECK-NEXT: warn_pragma_unknown_extension 131CHECK-NEXT: warn_pragma_unused_expected_punc 132CHECK-NEXT: warn_pragma_unused_expected_var 133CHECK-NEXT: warn_pragma_unused_expected_var_arg 134CHECK-NEXT: warn_pragma_unused_undeclared_var 135CHECK-NEXT: warn_property_attr_mismatch 136CHECK-NEXT: warn_property_attribute 137CHECK-NEXT: warn_property_getter_owning_mismatch 138CHECK-NEXT: warn_property_types_are_incompatible 139CHECK-NEXT: warn_readonly_property 140CHECK-NEXT: warn_redeclaration_without_attribute_prev_attribute_ignored 141CHECK-NEXT: warn_register_objc_catch_parm 142CHECK-NEXT: warn_related_result_type_compatibility_class 143CHECK-NEXT: warn_related_result_type_compatibility_protocol 144CHECK-NEXT: warn_static_non_static 145CHECK-NEXT: warn_template_export_unsupported 146CHECK-NEXT: warn_template_spec_extra_headers 147CHECK-NEXT: warn_tentative_incomplete_array 148CHECK-NEXT: warn_typecheck_function_qualifiers 149CHECK-NEXT: warn_unavailable_fwdclass_message 150CHECK-NEXT: warn_undef_interface 151CHECK-NEXT: warn_undef_interface_suggest 152CHECK-NEXT: warn_undef_protocolref 153CHECK-NEXT: warn_use_out_of_scope_declaration 154CHECK-NEXT: warn_weak_identifier_undeclared 155CHECK-NEXT: warn_weak_import 156 157The list of warnings in -Wpedantic should NEVER grow. 158 159CHECK: Number in -Wpedantic (not covered by other -W flags): 28 160