Kader updated this revision to Diff 180125. Kader added a comment. added missing test file
Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56241/new/ https://reviews.llvm.org/D56241 Files: include/clang/Basic/DiagnosticSemaKinds.td test/Misc/warning-flags.c test/Sema/ext-typecheck-comparison-of-pointer-integer.c Index: test/Sema/ext-typecheck-comparison-of-pointer-integer.c =================================================================== --- /dev/null +++ test/Sema/ext-typecheck-comparison-of-pointer-integer.c @@ -0,0 +1,5 @@ +// RUN: %clang_cc1 -triple x86_64-apple-darwin -fsyntax-only -verify -Wpointer-integer-compare %s + +int test_ext_typecheck_comparison_of_pointer_integer(int integer, int * pointer) { + return integer != pointer; // expected-warning {{comparison between pointer and integer ('int' and 'int *')}} +} Index: test/Misc/warning-flags.c =================================================================== --- test/Misc/warning-flags.c +++ test/Misc/warning-flags.c @@ -18,7 +18,7 @@ The list of warnings below should NEVER grow. It should gradually shrink to 0. -CHECK: Warnings without flags (75): +CHECK: Warnings without flags (74): CHECK-NEXT: ext_excess_initializers CHECK-NEXT: ext_excess_initializers_in_char_array_initializer CHECK-NEXT: ext_expected_semi_decl_list @@ -29,7 +29,6 @@ CHECK-NEXT: ext_new_paren_array_nonconst CHECK-NEXT: ext_plain_complex CHECK-NEXT: ext_template_arg_extra_parens -CHECK-NEXT: ext_typecheck_comparison_of_pointer_integer CHECK-NEXT: ext_typecheck_cond_incompatible_operands CHECK-NEXT: ext_typecheck_ordered_comparison_of_pointer_integer CHECK-NEXT: ext_using_undefined_std Index: include/clang/Basic/DiagnosticSemaKinds.td =================================================================== --- include/clang/Basic/DiagnosticSemaKinds.td +++ include/clang/Basic/DiagnosticSemaKinds.td @@ -5875,7 +5875,8 @@ def err_typecheck_comparison_of_fptr_to_void : Error< "equality comparison between function pointer and void pointer (%0 and %1)">; def ext_typecheck_comparison_of_pointer_integer : ExtWarn< - "comparison between pointer and integer (%0 and %1)">; + "comparison between pointer and integer (%0 and %1)">, + InGroup<DiagGroup<"pointer-integer-compare">>; def err_typecheck_comparison_of_pointer_integer : Error< "comparison between pointer and integer (%0 and %1)">; def ext_typecheck_comparison_of_distinct_pointers : ExtWarn<
Index: test/Sema/ext-typecheck-comparison-of-pointer-integer.c =================================================================== --- /dev/null +++ test/Sema/ext-typecheck-comparison-of-pointer-integer.c @@ -0,0 +1,5 @@ +// RUN: %clang_cc1 -triple x86_64-apple-darwin -fsyntax-only -verify -Wpointer-integer-compare %s + +int test_ext_typecheck_comparison_of_pointer_integer(int integer, int * pointer) { + return integer != pointer; // expected-warning {{comparison between pointer and integer ('int' and 'int *')}} +} Index: test/Misc/warning-flags.c =================================================================== --- test/Misc/warning-flags.c +++ test/Misc/warning-flags.c @@ -18,7 +18,7 @@ The list of warnings below should NEVER grow. It should gradually shrink to 0. -CHECK: Warnings without flags (75): +CHECK: Warnings without flags (74): CHECK-NEXT: ext_excess_initializers CHECK-NEXT: ext_excess_initializers_in_char_array_initializer CHECK-NEXT: ext_expected_semi_decl_list @@ -29,7 +29,6 @@ CHECK-NEXT: ext_new_paren_array_nonconst CHECK-NEXT: ext_plain_complex CHECK-NEXT: ext_template_arg_extra_parens -CHECK-NEXT: ext_typecheck_comparison_of_pointer_integer CHECK-NEXT: ext_typecheck_cond_incompatible_operands CHECK-NEXT: ext_typecheck_ordered_comparison_of_pointer_integer CHECK-NEXT: ext_using_undefined_std Index: include/clang/Basic/DiagnosticSemaKinds.td =================================================================== --- include/clang/Basic/DiagnosticSemaKinds.td +++ include/clang/Basic/DiagnosticSemaKinds.td @@ -5875,7 +5875,8 @@ def err_typecheck_comparison_of_fptr_to_void : Error< "equality comparison between function pointer and void pointer (%0 and %1)">; def ext_typecheck_comparison_of_pointer_integer : ExtWarn< - "comparison between pointer and integer (%0 and %1)">; + "comparison between pointer and integer (%0 and %1)">, + InGroup<DiagGroup<"pointer-integer-compare">>; def err_typecheck_comparison_of_pointer_integer : Error< "comparison between pointer and integer (%0 and %1)">; def ext_typecheck_comparison_of_distinct_pointers : ExtWarn<
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits