From: Nico Weber Date: Fri, 2 Mar 2012 20:23:08 +0000 (+0000) Subject: Move int<->pointer conversion warnings behind -Wint-conversions. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7d613bf78325695b16aa82c139dcc1d598c0f7aa;p=clang Move int<->pointer conversion warnings behind -Wint-conversions. This is consistent with -Wbool-conversion. Let me know if you prefer a different flag name. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151934 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Basic/DiagnosticGroups.td b/include/clang/Basic/DiagnosticGroups.td index f175b39d70..086a8b54aa 100644 --- a/include/clang/Basic/DiagnosticGroups.td +++ b/include/clang/Basic/DiagnosticGroups.td @@ -27,6 +27,7 @@ def : DiagGroup<"bad-function-cast">; def Availability : DiagGroup<"availability">; def AutoImport : DiagGroup<"auto-import">; def BoolConversions : DiagGroup<"bool-conversions">; +def IntConversions : DiagGroup<"int-conversions">; def BuiltinRequiresHeader : DiagGroup<"builtin-requires-header">; def CXXCompat: DiagGroup<"c++-compat">; def CastAlign : DiagGroup<"cast-align">; @@ -278,7 +279,8 @@ def Conversion : DiagGroup<"conversion", DiagGroup<"literal-conversion">, DiagGroup<"string-conversion">, DiagGroup<"sign-conversion">, - BoolConversions]>, + BoolConversions, + IntConversions]>, DiagCategory<"Value Conversion Issue">; def Unused : DiagGroup<"unused", diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index 78d1d8d3d4..dc888150b0 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -4201,7 +4201,8 @@ def ext_typecheck_convert_pointer_int : ExtWarn< "%select{|dereference with *|" "take the address with &|" "remove *|" - "remove &}3">; + "remove &}3">, + InGroup; def ext_typecheck_convert_int_pointer : ExtWarn< "incompatible integer to pointer conversion " "%select{assigning to|passing|returning|converting|initializing|sending|casting}2" @@ -4211,7 +4212,8 @@ def ext_typecheck_convert_int_pointer : ExtWarn< "%select{|dereference with *|" "take the address with &|" "remove *|" - "remove &}3">; + "remove &}3">, + InGroup; def ext_typecheck_convert_pointer_void_func : Extension< "%select{assigning to|passing|returning|converting|initializing|sending|casting}2" " %0 " diff --git a/test/Misc/serialized-diags.c b/test/Misc/serialized-diags.c index 8d2508771e..78b978320d 100644 --- a/test/Misc/serialized-diags.c +++ b/test/Misc/serialized-diags.c @@ -52,7 +52,7 @@ void testMacro() { // CHECK: +-Range: {{.*[/\\]}}serialized-diags.c:22:3 {{.*[/\\]}}serialized-diags.c:22:6 // CHECK: +-Range: {{.*[/\\]}}serialized-diags.c:20:15 {{.*[/\\]}}serialized-diags.c:20:16 // CHECK: +-{{.*[/\\]}}serialized-diags.c:19:1: note: 'taz' declared here [] -// CHECK: {{.*[/\\]}}serialized-diags.h:5:7: warning: incompatible integer to pointer conversion initializing 'char *' with an expression of type 'int'; [] +// CHECK: {{.*[/\\]}}serialized-diags.h:5:7: warning: incompatible integer to pointer conversion initializing 'char *' with an expression of type 'int'; [-Wint-conversions] // CHECK: Range: {{.*[/\\]}}serialized-diags.h:5:16 {{.*[/\\]}}serialized-diags.h:5:17 // CHECK: +-{{.*[/\\]}}serialized-diags.c:26:10: note: in file included from {{.*[/\\]}}serialized-diags.c:26: [] // CHECK: Number of diagnostics: 5 diff --git a/test/Misc/warning-flags.c b/test/Misc/warning-flags.c index 5c0e80055a..854ba3f983 100644 --- a/test/Misc/warning-flags.c +++ b/test/Misc/warning-flags.c @@ -17,7 +17,7 @@ This test serves two purposes: The list of warnings below should NEVER grow. It should gradually shrink to 0. -CHECK: Warnings without flags (256): +CHECK: Warnings without flags (254): CHECK-NEXT: ext_anonymous_struct_union_qualified CHECK-NEXT: ext_binary_literal CHECK-NEXT: ext_cast_fn_obj @@ -77,8 +77,6 @@ CHECK-NEXT: ext_typecheck_comparison_of_pointer_integer CHECK-NEXT: ext_typecheck_cond_incompatible_operands CHECK-NEXT: ext_typecheck_cond_incompatible_operands_nonstandard CHECK-NEXT: ext_typecheck_cond_one_void -CHECK-NEXT: ext_typecheck_convert_int_pointer -CHECK-NEXT: ext_typecheck_convert_pointer_int CHECK-NEXT: ext_typecheck_convert_pointer_void_func CHECK-NEXT: ext_typecheck_ordered_comparison_of_function_pointers CHECK-NEXT: ext_typecheck_ordered_comparison_of_pointer_and_zero