warning-flags.c revision 4b0e6f1da341510c1ad83eaf4c836f3134d0156a
1RUN: diagtool list-warnings 2>&1 | FileCheck %s
2
3This test serves two purposes:
4
5(1) It documents all existing warnings that currently have no associated -W flag,
6    and ensures that the list never grows.
7
8    If take an existing warning and add a flag, this test will fail.  To
9    fix this test, simply remove that warning from the list below.
10
11(2) It prevents us adding new warnings to Clang that have no -W flag.  All
12    new warnings should have -W flags.
13
14    If you add a new warning without a flag, this test will fail.  To fix
15    this test, simply add a warning group to that warning.
16
17
18The list of warnings below should NEVER grow.  It should gradually shrink to 0.
19
20CHECK: Warnings without flags (242):
21CHECK-NEXT:   ext_anonymous_struct_union_qualified
22CHECK-NEXT:   ext_binary_literal
23CHECK-NEXT:   ext_cast_fn_obj
24CHECK-NEXT:   ext_delete_void_ptr_operand
25CHECK-NEXT:   ext_designated_init
26CHECK-NEXT:   ext_duplicate_declspec
27CHECK-NEXT:   ext_ellipsis_exception_spec
28CHECK-NEXT:   ext_empty_fnmacro_arg
29CHECK-NEXT:   ext_empty_source_file
30CHECK-NEXT:   ext_enum_friend
31CHECK-NEXT:   ext_enum_value_not_int
32CHECK-NEXT:   ext_enumerator_list_comma
33CHECK-NEXT:   ext_expected_semi_decl_list
34CHECK-NEXT:   ext_explicit_instantiation_without_qualified_id
35CHECK-NEXT:   ext_explicit_specialization_storage_class
36CHECK-NEXT:   ext_forward_ref_enum
37CHECK-NEXT:   ext_freestanding_complex
38CHECK-NEXT:   ext_hexconstant_invalid
39CHECK-NEXT:   ext_ident_list_in_param
40CHECK-NEXT:   ext_imaginary_constant
41CHECK-NEXT:   ext_implicit_lib_function_decl
42CHECK-NEXT:   ext_in_class_initializer_non_constant
43CHECK-NEXT:   ext_integer_complement_complex
44CHECK-NEXT:   ext_integer_complex
45CHECK-NEXT:   ext_integer_increment_complex
46CHECK-NEXT:   ext_invalid_sign_spec
47CHECK-NEXT:   ext_missing_declspec
48CHECK-NEXT:   ext_missing_varargs_arg
49CHECK-NEXT:   ext_missing_whitespace_after_macro_name
50CHECK-NEXT:   ext_new_paren_array_nonconst
51CHECK-NEXT:   ext_nonstandard_escape
52CHECK-NEXT:   ext_param_not_declared
53CHECK-NEXT:   ext_paste_comma
54CHECK-NEXT:   ext_plain_complex
55CHECK-NEXT:   ext_pp_bad_vaargs_use
56CHECK-NEXT:   ext_pp_comma_expr
57CHECK-NEXT:   ext_pp_ident_directive
58CHECK-NEXT:   ext_pp_include_next_directive
59CHECK-NEXT:   ext_pp_line_too_big
60CHECK-NEXT:   ext_pp_macro_redef
61CHECK-NEXT:   ext_pp_warning_directive
62CHECK-NEXT:   ext_return_has_void_expr
63CHECK-NEXT:   ext_subscript_non_lvalue
64CHECK-NEXT:   ext_template_arg_extra_parens
65CHECK-NEXT:   ext_thread_before
66CHECK-NEXT:   ext_typecheck_addrof_void
67CHECK-NEXT:   ext_typecheck_cast_nonscalar
68CHECK-NEXT:   ext_typecheck_cast_to_union
69CHECK-NEXT:   ext_typecheck_comparison_of_distinct_pointers
70CHECK-NEXT:   ext_typecheck_comparison_of_distinct_pointers_nonstandard
71CHECK-NEXT:   ext_typecheck_comparison_of_fptr_to_void
72CHECK-NEXT:   ext_typecheck_comparison_of_pointer_integer
73CHECK-NEXT:   ext_typecheck_cond_incompatible_operands
74CHECK-NEXT:   ext_typecheck_cond_incompatible_operands_nonstandard
75CHECK-NEXT:   ext_typecheck_cond_one_void
76CHECK-NEXT:   ext_typecheck_convert_pointer_void_func
77CHECK-NEXT:   ext_typecheck_ordered_comparison_of_function_pointers
78CHECK-NEXT:   ext_typecheck_ordered_comparison_of_pointer_and_zero
79CHECK-NEXT:   ext_typecheck_ordered_comparison_of_pointer_integer
80CHECK-NEXT:   ext_typecheck_zero_array_size
81CHECK-NEXT:   ext_unknown_escape
82CHECK-NEXT:   ext_using_undefined_std
83CHECK-NEXT:   ext_vla_folded_to_constant
84CHECK-NEXT:   pp_include_next_absolute_path
85CHECK-NEXT:   pp_include_next_in_primary
86CHECK-NEXT:   pp_invalid_string_literal
87CHECK-NEXT:   pp_out_of_date_dependency
88CHECK-NEXT:   pp_poisoning_existing_macro
89CHECK-NEXT:   pp_pragma_once_in_main_file
90CHECK-NEXT:   pp_pragma_sysheader_in_main_file
91CHECK-NEXT:   pp_undef_builtin_macro
92CHECK-NEXT:   w_asm_qualifier_ignored
93CHECK-NEXT:   warn_accessor_property_type_mismatch
94CHECK-NEXT:   warn_anon_bitfield_width_exceeds_type_size
95CHECK-NEXT:   warn_asm_label_on_auto_decl
96CHECK-NEXT:   warn_attribute_ibaction
97CHECK-NEXT:   warn_attribute_iboutlet
98CHECK-NEXT:   warn_attribute_ignored
99CHECK-NEXT:   warn_attribute_ignored_for_field_of_type
100CHECK-NEXT:   warn_attribute_malloc_pointer_only
101CHECK-NEXT:   warn_attribute_nonnull_no_pointers
102CHECK-NEXT:   warn_attribute_precede_definition
103CHECK-NEXT:   warn_attribute_sentinel_named_arguments
104CHECK-NEXT:   warn_attribute_sentinel_not_variadic
105CHECK-NEXT:   warn_attribute_type_not_supported
106CHECK-NEXT:   warn_attribute_unknown_visibility
107CHECK-NEXT:   warn_attribute_void_function_method
108CHECK-NEXT:   warn_attribute_weak_import_invalid_on_definition
109CHECK-NEXT:   warn_attribute_weak_on_field
110CHECK-NEXT:   warn_attribute_weak_on_local
111CHECK-NEXT:   warn_attribute_wrong_decl_type
112CHECK-NEXT:   warn_bad_receiver_type
113CHECK-NEXT:   warn_bitfield_width_exceeds_type_size
114CHECK-NEXT:   warn_bool_switch_condition
115CHECK-NEXT:   warn_braces_around_scalar_init
116CHECK-NEXT:   warn_c_kext
117CHECK-NEXT:   warn_call_to_pure_virtual_member_function_from_ctor_dtor
118CHECK-NEXT:   warn_call_wrong_number_of_arguments
119CHECK-NEXT:   warn_case_empty_range
120CHECK-NEXT:   warn_char_constant_too_large
121CHECK-NEXT:   warn_class_method_not_found
122CHECK-NEXT:   warn_cmdline_missing_macro_defs
123CHECK-NEXT:   warn_collection_expr_type
124CHECK-NEXT:   warn_conflicting_param_types
125CHECK-NEXT:   warn_conflicting_ret_types
126CHECK-NEXT:   warn_conflicting_variadic
127CHECK-NEXT:   warn_conv_to_base_not_used
128CHECK-NEXT:   warn_conv_to_self_not_used
129CHECK-NEXT:   warn_conv_to_void_not_used
130CHECK-NEXT:   warn_delete_array_type
131CHECK-NEXT:   warn_double_const_requires_fp64
132CHECK-NEXT:   warn_drv_assuming_mfloat_abi_is
133CHECK-NEXT:   warn_drv_clang_unsupported
134CHECK-NEXT:   warn_drv_input_file_unused
135CHECK-NEXT:   warn_drv_not_using_clang_arch
136CHECK-NEXT:   warn_drv_not_using_clang_cpp
137CHECK-NEXT:   warn_drv_not_using_clang_cxx
138CHECK-NEXT:   warn_drv_objc_gc_unsupported
139CHECK-NEXT:   warn_drv_pch_not_first_include
140CHECK-NEXT:   warn_drv_preprocessed_input_file_unused
141CHECK-NEXT:   warn_dup_category_def
142CHECK-NEXT:   warn_duplicate_protocol_def
143CHECK-NEXT:   warn_enum_too_large
144CHECK-NEXT:   warn_enum_value_overflow
145CHECK-NEXT:   warn_enumerator_too_large
146CHECK-NEXT:   warn_exception_caught_by_earlier_handler
147CHECK-NEXT:   warn_excess_initializers
148CHECK-NEXT:   warn_excess_initializers_in_char_array_initializer
149CHECK-NEXT:   warn_expected_qualified_after_typename
150CHECK-NEXT:   warn_extern_init
151CHECK-NEXT:   warn_extraneous_char_constant
152CHECK-NEXT:   warn_fe_cc_log_diagnostics_failure
153CHECK-NEXT:   warn_fe_cc_print_header_failure
154CHECK-NEXT:   warn_fe_macro_contains_embedded_newline
155CHECK-NEXT:   warn_file_asm_volatile
156CHECK-NEXT:   warn_function_attribute_wrong_type
157CHECK-NEXT:   warn_gc_attribute_weak_on_local
158CHECK-NEXT:   warn_gnu_inline_attribute_requires_inline
159CHECK-NEXT:   warn_hex_escape_too_large
160CHECK-NEXT:   warn_ignoring_ftabstop_value
161CHECK-NEXT:   warn_illegal_constant_array_size
162CHECK-NEXT:   warn_implements_nscopying
163CHECK-NEXT:   warn_incompatible_qualified_id
164CHECK-NEXT:   warn_initializer_string_for_char_array_too_long
165CHECK-NEXT:   warn_inline_namespace_reopened_noninline
166CHECK-NEXT:   warn_inst_method_not_found
167CHECK-NEXT:   warn_instance_method_on_class_found
168CHECK-NEXT:   warn_integer_too_large
169CHECK-NEXT:   warn_integer_too_large_for_signed
170CHECK-NEXT:   warn_invalid_asm_cast_lvalue
171CHECK-NEXT:   warn_many_braces_around_scalar_init
172CHECK-NEXT:   warn_maynot_respond
173CHECK-NEXT:   warn_member_extra_qualification
174CHECK-NEXT:   warn_method_param_redefinition
175CHECK-NEXT:   warn_mismatched_exception_spec
176CHECK-NEXT:   warn_missing_case_for_condition
177CHECK-NEXT:   warn_missing_dependent_template_keyword
178CHECK-NEXT:   warn_missing_exception_specification
179CHECK-NEXT:   warn_missing_whitespace_after_macro_name
180CHECK-NEXT:   warn_multiple_method_decl
181CHECK-NEXT:   warn_no_constructor_for_refconst
182CHECK-NEXT:   warn_nonnull_pointers_only
183CHECK-NEXT:   warn_not_compound_assign
184CHECK-NEXT:   warn_ns_attribute_wrong_parameter_type
185CHECK-NEXT:   warn_ns_attribute_wrong_return_type
186CHECK-NEXT:   warn_objc_object_attribute_wrong_type
187CHECK-NEXT:   warn_objc_property_copy_missing_on_block
188CHECK-NEXT:   warn_objc_protocol_qualifier_missing_id
189CHECK-NEXT:   warn_octal_escape_too_large
190CHECK-NEXT:   warn_odr_tag_type_inconsistent
191CHECK-NEXT:   warn_on_superclass_use
192CHECK-NEXT:   warn_param_default_argument_redefinition
193CHECK-NEXT:   warn_partial_specs_not_deducible
194CHECK-NEXT:   warn_pointer_attribute_wrong_type
195CHECK-NEXT:   warn_pp_convert_lhs_to_positive
196CHECK-NEXT:   warn_pp_convert_rhs_to_positive
197CHECK-NEXT:   warn_pp_expr_overflow
198CHECK-NEXT:   warn_pp_line_decimal
199CHECK-NEXT:   warn_pragma_align_expected_equal
200CHECK-NEXT:   warn_pragma_align_invalid_option
201CHECK-NEXT:   warn_pragma_debug_unexpected_command
202CHECK-NEXT:   warn_pragma_expected_colon
203CHECK-NEXT:   warn_pragma_expected_enable_disable
204CHECK-NEXT:   warn_pragma_expected_identifier
205CHECK-NEXT:   warn_pragma_expected_lparen
206CHECK-NEXT:   warn_pragma_expected_rparen
207CHECK-NEXT:   warn_pragma_extra_tokens_at_eol
208CHECK-NEXT:   warn_pragma_ms_struct
209CHECK-NEXT:   warn_pragma_options_align_reset_failed
210CHECK-NEXT:   warn_pragma_options_align_unsupported_option
211CHECK-NEXT:   warn_pragma_options_expected_align
212CHECK-NEXT:   warn_pragma_pack_invalid_action
213CHECK-NEXT:   warn_pragma_pack_invalid_alignment
214CHECK-NEXT:   warn_pragma_pack_malformed
215CHECK-NEXT:   warn_pragma_pack_pop_failed
216CHECK-NEXT:   warn_pragma_pack_pop_identifer_and_alignment
217CHECK-NEXT:   warn_pragma_pack_show
218CHECK-NEXT:   warn_pragma_pop_macro_no_push
219CHECK-NEXT:   warn_pragma_unknown_extension
220CHECK-NEXT:   warn_pragma_unused_expected_punc
221CHECK-NEXT:   warn_pragma_unused_expected_var
222CHECK-NEXT:   warn_pragma_unused_expected_var_arg
223CHECK-NEXT:   warn_pragma_unused_undeclared_var
224CHECK-NEXT:   warn_previous_alias_decl
225CHECK-NEXT:   warn_printf_asterisk_missing_arg
226CHECK-NEXT:   warn_property_attr_mismatch
227CHECK-NEXT:   warn_property_attribute
228CHECK-NEXT:   warn_property_getter_owning_mismatch
229CHECK-NEXT:   warn_property_types_are_incompatible
230CHECK-NEXT:   warn_readonly_property
231CHECK-NEXT:   warn_receiver_forward_class
232CHECK-NEXT:   warn_redecl_library_builtin
233CHECK-NEXT:   warn_redeclaration_without_attribute_prev_attribute_ignored
234CHECK-NEXT:   warn_register_objc_catch_parm
235CHECK-NEXT:   warn_related_result_type_compatibility_class
236CHECK-NEXT:   warn_related_result_type_compatibility_protocol
237CHECK-NEXT:   warn_root_inst_method_not_found
238CHECK-NEXT:   warn_second_parameter_of_va_start_not_last_named_argument
239CHECK-NEXT:   warn_second_parameter_to_va_arg_never_compatible
240CHECK-NEXT:   warn_standalone_specifier
241CHECK-NEXT:   warn_static_inline_explicit_inst_ignored
242CHECK-NEXT:   warn_static_non_static
243CHECK-NEXT:   warn_template_export_unsupported
244CHECK-NEXT:   warn_template_spec_extra_headers
245CHECK-NEXT:   warn_tentative_incomplete_array
246CHECK-NEXT:   warn_transparent_union_attribute_field_size_align
247CHECK-NEXT:   warn_transparent_union_attribute_floating
248CHECK-NEXT:   warn_transparent_union_attribute_not_definition
249CHECK-NEXT:   warn_transparent_union_attribute_zero_fields
250CHECK-NEXT:   warn_typecheck_function_qualifiers
251CHECK-NEXT:   warn_unavailable_fwdclass_message
252CHECK-NEXT:   warn_undef_interface
253CHECK-NEXT:   warn_undef_interface_suggest
254CHECK-NEXT:   warn_undef_protocolref
255CHECK-NEXT:   warn_undefined_internal
256CHECK-NEXT:   warn_unknown_analyzer_checker
257CHECK-NEXT:   warn_unknown_method_family
258CHECK-NEXT:   warn_unterminated_char
259CHECK-NEXT:   warn_unterminated_string
260CHECK-NEXT:   warn_use_out_of_scope_declaration
261CHECK-NEXT:   warn_weak_identifier_undeclared
262CHECK-NEXT:   warn_weak_import
263