aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-family
diff options
context:
space:
mode:
authorNicola Pero <nicola.pero@meta-innovation.com>2010-11-01 22:54:35 +0000
committerNicola Pero <nicola@gcc.gnu.org>2010-11-01 22:54:35 +0000
commit2debdb4fcd1064967709bd839e4b751f480f7fbd (patch)
tree9e084aedbf6e31a6763dd3a170066bbe479e30e6 /gcc/c-family
parentdb4e59bb2b2d8449f1eb836d5075cf0dd9875159 (diff)
downloadgcc-2debdb4fcd1064967709bd839e4b751f480f7fbd.zip
gcc-2debdb4fcd1064967709bd839e4b751f480f7fbd.tar.gz
gcc-2debdb4fcd1064967709bd839e4b751f480f7fbd.tar.bz2
In gcc/c-family/: 2010-11-01 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/c-family/: 2010-11-01 Nicola Pero <nicola.pero@meta-innovation.com> Implemented format and noreturn attributes for Objective-C methods. * c-common.c (handle_noreturn_attribute): Recognize 'noreturn' attribute for Objective-C methods. In gcc/objc/: 2010-11-01 Nicola Pero <nicola.pero@meta-innovation.com> Implemented format and noreturn attributes for Objective-C methods. * objc-act.c (objc_start_method_definition): If method attributes are specified emit a warning and ignore them. (build_objc_method_call): Moved deprecation warnings from here ... (objc_finish_message_expr): to here. Do not emit deprecation warnings if the receiver is of type 'id'. (really_start_method): Install 'deprecation' and 'noreturn' attributes. (objc_decl_method_attributes): Carefully filter out the list of attributes, allowing only "noreturn", "format", "sentinel" and "deprecated". In the case of "format", adjust the arguments. Always process the attributes in the same way no matter if "sentinel" is in the list or not. In gcc/testsuite/: 2010-11-01 Nicola Pero <nicola.pero@meta-innovation.com> Implemented format and noreturn attributes for Objective-C methods. * objc.dg/attributes/method-attribute-2.m: Updated warnings. * objc.dg/attributes/method-deprecated-1.m: New. * objc.dg/attributes/method-deprecated-2.m: New. * objc.dg/attributes/method-deprecated-3.m: New. * objc.dg/attributes/method-noreturn-1.m: New. * objc.dg/attributes/method-sentinel-1.m: New. * objc.dg/attributes/method-format-1.m: New. * obj-c++.dg/attributes/method-attribute-2.mm: Updated warnings. * obj-c++.dg/attributes/method-deprecated-1.mm: New. * obj-c++.dg/attributes/method-deprecated-2.mm: New. * obj-c++.dg/attributes/method-deprecated-3.mm: New. * obj-c++.dg/attributes/method-noreturn-1.mm: New. * obj-c++.dg/attributes/method-sentinel-1.mm: New. * obj-c++.dg/attributes/method-format-1.mm: New. From-SVN: r166153
Diffstat (limited to 'gcc/c-family')
-rw-r--r--gcc/c-family/ChangeLog6
-rw-r--r--gcc/c-family/c-common.c3
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index cb5b5dc..b2c9011 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,9 @@
+2010-11-01 Nicola Pero <nicola.pero@meta-innovation.com>
+
+ Implemented format and noreturn attributes for Objective-C methods.
+ * c-common.c (handle_noreturn_attribute): Recognize 'noreturn'
+ attribute for Objective-C methods.
+
2010-10-31 Jason Merrill <jason@redhat.com>
* c-common.c (conversion_warning, warn_for_collisions_1): Use
diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
index 923c63a..ab050ab 100644
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -5729,7 +5729,8 @@ handle_noreturn_attribute (tree *node, tree name, tree ARG_UNUSED (args),
tree type = TREE_TYPE (*node);
/* See FIXME comment in c_common_attribute_table. */
- if (TREE_CODE (*node) == FUNCTION_DECL)
+ if (TREE_CODE (*node) == FUNCTION_DECL
+ || objc_method_decl (TREE_CODE (*node)))
TREE_THIS_VOLATILE (*node) = 1;
else if (TREE_CODE (type) == POINTER_TYPE
&& TREE_CODE (TREE_TYPE (type)) == FUNCTION_TYPE)