aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>2000-09-20 19:35:10 +0000
committerRichard Kenner <kenner@vlsi1.ultra.nyu.edu>2000-09-20 19:35:10 +0000
commita8fc790630b96deb3ed8f69a8a6251f5163a9987 (patch)
treea511ef44ecee35f14e7e6a20394f0901dfdb869d
parent5cf6ac9ba20fddba908c6827d91227e98e4166a0 (diff)
* c-decl.c (finish_decl): Add else's to avoid referencing
TYPE_DOMAIN of an ERROR_MARK. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@36554 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/c-decl.c6
2 files changed, 8 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b4b3480732c..84f70971a01 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+Wed Sep 20 15:39:14 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * c-decl.c (finish_decl): Add else's to avoid referencing
+ TYPE_DOMAIN of an ERROR_MARK.
+
Wed Sep 20 21:44:31 2000 Denis Chertykov <denisc@overta.ru>
* config/avr/avr.c (adjust_insn_length): Adjust lengths of
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index c892719855f..a197601407a 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -3635,7 +3635,7 @@ finish_decl (decl, init, asmspec_tree)
if (failure == 1)
error_with_decl (decl, "initializer fails to determine size of `%s'");
- if (failure == 2)
+ else if (failure == 2)
{
if (do_default)
error_with_decl (decl, "array size missing in `%s'");
@@ -3652,8 +3652,8 @@ finish_decl (decl, init, asmspec_tree)
/* TYPE_MAX_VALUE is always one less than the number of elements
in the array, because we start counting at zero. Therefore,
warn only if the value is less than zero. */
- if (pedantic && TYPE_DOMAIN (type) != 0
- && tree_int_cst_sgn (TYPE_MAX_VALUE (TYPE_DOMAIN (type))) < 0)
+ else if (pedantic && TYPE_DOMAIN (type) != 0
+ && tree_int_cst_sgn (TYPE_MAX_VALUE (TYPE_DOMAIN (type))) < 0)
error_with_decl (decl, "zero or negative size array `%s'");
layout_decl (decl, 0);