warning-flags.c 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. RUN: diagtool list-warnings > %t 2>&1
  2. RUN: FileCheck --input-file=%t %s
  3. This test serves two purposes:
  4. (1) It documents all existing warnings that currently have no associated -W flag,
  5. and ensures that the list never grows.
  6. If take an existing warning and add a flag, this test will fail. To
  7. fix this test, simply remove that warning from the list below.
  8. (2) It prevents us adding new warnings to Clang that have no -W flag. All
  9. new warnings should have -W flags.
  10. If you add a new warning without a flag, this test will fail. To fix
  11. this test, simply add a warning group to that warning.
  12. The list of warnings below should NEVER grow. It should gradually shrink to 0.
  13. CHECK: Warnings without flags (93):
  14. CHECK-NEXT: ext_excess_initializers
  15. CHECK-NEXT: ext_excess_initializers_in_char_array_initializer
  16. CHECK-NEXT: ext_expected_semi_decl_list
  17. CHECK-NEXT: ext_explicit_specialization_storage_class
  18. CHECK-NEXT: ext_implicit_lib_function_decl
  19. CHECK-NEXT: ext_initializer_string_for_char_array_too_long
  20. CHECK-NEXT: ext_missing_declspec
  21. CHECK-NEXT: ext_missing_whitespace_after_macro_name
  22. CHECK-NEXT: ext_new_paren_array_nonconst
  23. CHECK-NEXT: ext_plain_complex
  24. CHECK-NEXT: ext_template_arg_extra_parens
  25. CHECK-NEXT: ext_typecheck_comparison_of_pointer_integer
  26. CHECK-NEXT: ext_typecheck_cond_incompatible_operands
  27. CHECK-NEXT: ext_typecheck_cond_incompatible_operands_nonstandard
  28. CHECK-NEXT: ext_typecheck_ordered_comparison_of_function_pointers
  29. CHECK-NEXT: ext_typecheck_ordered_comparison_of_pointer_integer
  30. CHECK-NEXT: ext_using_undefined_std
  31. CHECK-NEXT: pp_include_next_absolute_path
  32. CHECK-NEXT: pp_include_next_in_primary
  33. CHECK-NEXT: pp_invalid_string_literal
  34. CHECK-NEXT: pp_out_of_date_dependency
  35. CHECK-NEXT: pp_poisoning_existing_macro
  36. CHECK-NEXT: pp_pragma_once_in_main_file
  37. CHECK-NEXT: pp_pragma_sysheader_in_main_file
  38. CHECK-NEXT: w_asm_qualifier_ignored
  39. CHECK-NEXT: warn_accessor_property_type_mismatch
  40. CHECK-NEXT: warn_anon_bitfield_width_exceeds_type_size
  41. CHECK-NEXT: warn_arcmt_nsalloc_realloc
  42. CHECK-NEXT: warn_asm_label_on_auto_decl
  43. CHECK-NEXT: warn_bitfield_width_exceeds_type_size
  44. CHECK-NEXT: warn_c_kext
  45. CHECK-NEXT: warn_call_to_pure_virtual_member_function_from_ctor_dtor
  46. CHECK-NEXT: warn_call_wrong_number_of_arguments
  47. CHECK-NEXT: warn_case_empty_range
  48. CHECK-NEXT: warn_char_constant_too_large
  49. CHECK-NEXT: warn_collection_expr_type
  50. CHECK-NEXT: warn_conflicting_variadic
  51. CHECK-NEXT: warn_conv_to_base_not_used
  52. CHECK-NEXT: warn_conv_to_self_not_used
  53. CHECK-NEXT: warn_conv_to_void_not_used
  54. CHECK-NEXT: warn_delete_array_type
  55. CHECK-NEXT: warn_double_const_requires_fp64
  56. CHECK-NEXT: warn_drv_assuming_mfloat_abi_is
  57. CHECK-NEXT: warn_drv_clang_unsupported
  58. CHECK-NEXT: warn_drv_objc_gc_unsupported
  59. CHECK-NEXT: warn_drv_pch_not_first_include
  60. CHECK-NEXT: warn_dup_category_def
  61. CHECK-NEXT: warn_duplicate_protocol_def
  62. CHECK-NEXT: warn_enum_value_overflow
  63. CHECK-NEXT: warn_expected_qualified_after_typename
  64. CHECK-NEXT: warn_extraneous_char_constant
  65. CHECK-NEXT: warn_fe_cc_log_diagnostics_failure
  66. CHECK-NEXT: warn_fe_cc_print_header_failure
  67. CHECK-NEXT: warn_fe_macro_contains_embedded_newline
  68. CHECK-NEXT: warn_file_asm_volatile
  69. CHECK-NEXT: warn_ignoring_ftabstop_value
  70. CHECK-NEXT: warn_implements_nscopying
  71. CHECK-NEXT: warn_incompatible_qualified_id
  72. CHECK-NEXT: warn_inline_namespace_reopened_noninline
  73. CHECK-NEXT: warn_invalid_asm_cast_lvalue
  74. CHECK-NEXT: warn_maynot_respond
  75. CHECK-NEXT: warn_method_param_redefinition
  76. CHECK-NEXT: warn_missing_case_for_condition
  77. CHECK-NEXT: warn_missing_dependent_template_keyword
  78. CHECK-NEXT: warn_missing_exception_specification
  79. CHECK-NEXT: warn_missing_whitespace_after_macro_name
  80. CHECK-NEXT: warn_mt_message
  81. CHECK-NEXT: warn_no_constructor_for_refconst
  82. CHECK-NEXT: warn_not_compound_assign
  83. CHECK-NEXT: warn_objc_property_copy_missing_on_block
  84. CHECK-NEXT: warn_objc_protocol_qualifier_missing_id
  85. CHECK-NEXT: warn_on_superclass_use
  86. CHECK-NEXT: warn_partial_specs_not_deducible
  87. CHECK-NEXT: warn_pp_convert_lhs_to_positive
  88. CHECK-NEXT: warn_pp_convert_rhs_to_positive
  89. CHECK-NEXT: warn_pp_expr_overflow
  90. CHECK-NEXT: warn_pp_line_decimal
  91. CHECK-NEXT: warn_pragma_pack_pop_identifer_and_alignment
  92. CHECK-NEXT: warn_pragma_pack_show
  93. CHECK-NEXT: warn_property_getter_owning_mismatch
  94. CHECK-NEXT: warn_register_objc_catch_parm
  95. CHECK-NEXT: warn_related_result_type_compatibility_class
  96. CHECK-NEXT: warn_related_result_type_compatibility_protocol
  97. CHECK-NEXT: warn_template_export_unsupported
  98. CHECK-NEXT: warn_template_spec_extra_headers
  99. CHECK-NEXT: warn_tentative_incomplete_array
  100. CHECK-NEXT: warn_typecheck_function_qualifiers
  101. CHECK-NEXT: warn_undef_interface
  102. CHECK-NEXT: warn_undef_interface_suggest
  103. CHECK-NEXT: warn_undef_protocolref
  104. CHECK-NEXT: warn_use_out_of_scope_declaration
  105. CHECK-NEXT: warn_weak_identifier_undeclared
  106. CHECK-NEXT: warn_weak_import
  107. The list of warnings in -Wpedantic should NEVER grow.
  108. CHECK: Number in -Wpedantic (not covered by other -W flags): 28