This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Minor buglet in c-decl.c
- To: gcc-patches at gcc dot gnu dot org
- Subject: Minor buglet in c-decl.c
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- Date: Wed, 20 Sep 00 15:49:45 EDT
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.
*** c-decl.c 2000/09/19 07:59:58 1.160
--- c-decl.c 2000/09/20 14:51:07
*************** finish_decl (decl, init, asmspec_tree)
*** 3636,3640 ****
error_with_decl (decl, "initializer fails to determine size of `%s'");
! if (failure == 2)
{
if (do_default)
--- 3636,3640 ----
error_with_decl (decl, "initializer fails to determine size of `%s'");
! else if (failure == 2)
{
if (do_default)
*************** finish_decl (decl, init, asmspec_tree)
*** 3653,3658 ****
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)
error_with_decl (decl, "zero or negative size array `%s'");
--- 3653,3658 ----
in the array, because we start counting at zero. Therefore,
warn only if the value is less than zero. */
! 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'");