From: Richard Stallman Date: Tue, 16 Mar 1993 04:53:55 +0000 (+0000) Subject: (grokdeclarator): Error for div by 0 in array size. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1a6603daede2865e5ffc12f493df87ff834cc292;p=gcc.git (grokdeclarator): Error for div by 0 in array size. From-SVN: r3753 --- diff --git a/gcc/c-decl.c b/gcc/c-decl.c index e9b722dae09..80844596da8 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -4087,7 +4087,12 @@ grokdeclarator (declarator, declspecs, decl_context, initialized) else { if (pedantic) - pedwarn ("ANSI C forbids variable-size array `%s'", name); + { + if (TREE_CONSTANT (size)) + pedwarn ("ANSI C forbids array `%s' whose size can't be evaluated", name); + else + pedwarn ("ANSI C forbids variable-size array `%s'", name); + } itype = build_binary_op (MINUS_EXPR, size, integer_one_node, 1); /* Make sure the array size remains visibly nonconstant