aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>2000-09-20 19:35:10 +0000
committerRichard Kenner <kenner@gcc.gnu.org>2000-09-20 15:35:10 -0400
commit5fa7c8cec4c4d452a4283b9a52b9de9b2e5211b7 (patch)
treea511ef44ecee35f14e7e6a20394f0901dfdb869d /gcc/c-decl.c
parentfab701dab01ecbf5dfef464064f71bf3067d39db (diff)
downloadgcc-5fa7c8cec4c4d452a4283b9a52b9de9b2e5211b7.zip
gcc-5fa7c8cec4c4d452a4283b9a52b9de9b2e5211b7.tar.gz
gcc-5fa7c8cec4c4d452a4283b9a52b9de9b2e5211b7.tar.bz2
c-decl.c (finish_decl): Add else's to avoid referencing TYPE_DOMAIN of an ERROR_MARK.
* c-decl.c (finish_decl): Add else's to avoid referencing TYPE_DOMAIN of an ERROR_MARK. From-SVN: r36554
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index c892719..a197601 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);