]> granicus.if.org Git - clang/commitdiff
PR4800: Implement -Wpointer-arith. I think this is the correct behavior
authorEli Friedman <eli.friedman@gmail.com>
Thu, 27 Aug 2009 17:20:36 +0000 (17:20 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Thu, 27 Aug 2009 17:20:36 +0000 (17:20 +0000)
per the documentation, although I'm not completely sure.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80257 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/DiagnosticGroups.td
include/clang/Basic/DiagnosticSemaKinds.td

index 34bea5b1acb6ae5de75f1d42c8514db60764ee8e..fab4614d174d99ddf1b0faac7c4347eb8316adab 100644 (file)
@@ -58,7 +58,7 @@ def : DiagGroup<"nonportable-cfstrings">;
 def : DiagGroup<"old-style-definition">;
 def : DiagGroup<"packed">;
 def Parentheses : DiagGroup<"parentheses">;
-def : DiagGroup<"pointer-arith">;
+def PointerArith : DiagGroup<"pointer-arith">;
 def : DiagGroup<"pointer-to-int-cast">;
 def : DiagGroup<"redundant-decls">;
 def ReturnType : DiagGroup<"return-type">;
index fe7ab08434bfb187b444852cd05a665b10aeb565..143f84a9c2f8425fbd837d5586f96cf80564b593 100644 (file)
@@ -1225,9 +1225,9 @@ def err_func_def_incomplete_result : Error<
 
 // Expressions.
 def ext_sizeof_function_type : Extension<
-  "invalid application of 'sizeof' to a function type">;
+  "invalid application of 'sizeof' to a function type">, InGroup<PointerArith>;
 def ext_sizeof_void_type : Extension<
-  "invalid application of '%0' to a void type">;
+  "invalid application of '%0' to a void type">, InGroup<PointerArith>;
 // FIXME: merge with %select
 def err_sizeof_incomplete_type : Error<
   "invalid application of 'sizeof' to an incomplete type %0">;
@@ -1402,9 +1402,10 @@ def err_unexpected_interface : Error<
 def err_property_not_found : Error<
   "property %0 not found on object of type %1">;
 def ext_gnu_void_ptr : Extension<
-  "use of GNU void* extension">;
+  "use of GNU void* extension">, InGroup<PointerArith>;
 def ext_gnu_ptr_func_arith : Extension<
-  "arithmetic on pointer to function type %0 is a GNU extension">;
+  "arithmetic on pointer to function type %0 is a GNU extension">,
+  InGroup<PointerArith>;
 def error_readonly_property_assignment : Error<
   "assigning to property with 'readonly' attribute not allowed">;
 def ext_integer_increment_complex : Extension<