aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@yorick.cygnus.com>1998-11-29 23:01:19 +0000
committerJason Merrill <jason@gcc.gnu.org>1998-11-29 18:01:19 -0500
commit9bbdf48eea4093baee7f2c7438439ac848855e4b (patch)
tree60e6cc8d8ee7bb0c07e450ba1d75e9e02d9813bf /gcc
parentc4ec74e871284bb837afd29d0324f87361e32677 (diff)
downloadgcc-9bbdf48eea4093baee7f2c7438439ac848855e4b.zip
gcc-9bbdf48eea4093baee7f2c7438439ac848855e4b.tar.gz
gcc-9bbdf48eea4093baee7f2c7438439ac848855e4b.tar.bz2
except.c (add_new_handler): Complain about additional handlers after one that catches everything.
* except.c (add_new_handler): Complain about additional handlers after one that catches everything. From-SVN: r23990
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/except.c9
2 files changed, 12 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 987262b..c00c1b5 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+Sun Nov 29 22:59:40 1998 Jason Merrill <jason@yorick.cygnus.com>
+
+ * except.c (add_new_handler): Complain about additional handlers
+ after one that catches everything.
+
Sat Nov 28 10:56:32 1998 Jeffrey A Law (law@cygnus.com)
* configure.in (alpha*-*-netbsd): Fix typo.
diff --git a/gcc/except.c b/gcc/except.c
index ae6ede2..70e19ef10 100644
--- a/gcc/except.c
+++ b/gcc/except.c
@@ -767,8 +767,13 @@ add_new_handler (region, newhandler)
function_eh_regions[region].handlers = newhandler;
else
{
- for ( ; last->next != NULL; last = last->next)
- ;
+ for ( ; ; last = last->next)
+ {
+ if (last->type_info == CATCH_ALL_TYPE)
+ pedwarn ("additional handler after ...");
+ if (last->next == NULL)
+ break;
+ }
last->next = newhandler;
}
}