summaryrefslogtreecommitdiff
path: root/gcc/objc
diff options
context:
space:
mode:
authornicola <nicola@138bc75d-0d04-0410-961f-82ee72b054a4>2010-09-10 09:54:04 +0000
committernicola <nicola@138bc75d-0d04-0410-961f-82ee72b054a4>2010-09-10 09:54:04 +0000
commit48ca71c2ee8969922055237f5f651e454e2d741c (patch)
treea5cb1320835c159f8f05246fc2a57f4d81e9e270 /gcc/objc
parent784d42309d8b27fd886ee74b8b6a6111ec60b85c (diff)
downloadgcc-48ca71c2ee8969922055237f5f651e454e2d741c.tar.gz
* objc/objc-act.c (objc_begin_try_stmt): Generate an error if
-fobjc-exceptions was not used. (objc_build_throw_stmt): Same change. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@164150 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/objc')
-rw-r--r--gcc/objc/ChangeLog6
-rw-r--r--gcc/objc/objc-act.c23
2 files changed, 17 insertions, 12 deletions
diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog
index de6cbebd2ad..aff287b9156 100644
--- a/gcc/objc/ChangeLog
+++ b/gcc/objc/ChangeLog
@@ -1,3 +1,9 @@
+2010-09-10 Nicola Pero <nicola.pero@meta-innovation.com>
+
+ * objc/objc-act.c (objc_begin_try_stmt): Generate an error if
+ -fobjc-exceptions was not used. (objc_build_throw_stmt): Same
+ change.
+
2010-07-15 Nathan Froyd <froydnj@codesourcery.com>
* objc-act.c: Carefully replace TREE_CHAIN with DECL_CHAIN.
diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c
index 81aba84eb97..38420c7a03c 100644
--- a/gcc/objc/objc-act.c
+++ b/gcc/objc/objc-act.c
@@ -3822,13 +3822,16 @@ objc_begin_try_stmt (location_t try_locus, tree body)
c->end_try_locus = input_location;
cur_try_context = c;
- if (flag_objc_sjlj_exceptions)
+ /* -fobjc-exceptions is required to enable Objective-C exceptions.
+ For example, on Darwin, ObjC exceptions require a sufficiently
+ recent version of the runtime, so the user must ask for them
+ explicitly. On other platforms, at the moment -fobjc-exceptions
+ triggers -fexceptions which again is required for exceptions to
+ work.
+ */
+ if (!flag_objc_exceptions)
{
- /* On Darwin, ObjC exceptions require a sufficiently recent
- version of the runtime, so the user must ask for them explicitly. */
- if (!flag_objc_exceptions)
- warning (0, "use %<-fobjc-exceptions%> to enable Objective-C "
- "exception syntax");
+ error_at (try_locus, "%<-fobjc-exceptions%> is required to enable Objective-C exception syntax");
}
if (flag_objc_sjlj_exceptions)
@@ -3979,13 +3982,9 @@ objc_build_throw_stmt (location_t loc, tree throw_expr)
{
tree args;
- if (flag_objc_sjlj_exceptions)
+ if (!flag_objc_exceptions)
{
- /* On Darwin, ObjC exceptions require a sufficiently recent
- version of the runtime, so the user must ask for them explicitly. */
- if (!flag_objc_exceptions)
- warning (0, "use %<-fobjc-exceptions%> to enable Objective-C "
- "exception syntax");
+ error_at (loc, "%<-fobjc-exceptions%> is required to enable Objective-C exception syntax");
}
if (throw_expr == NULL)