projects
/
gcc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d50c1d4
)
(grokdeclarator): Error for div by 0 in array size.
author
Richard Stallman
<rms@gnu.org>
Tue, 16 Mar 1993 04:53:55 +0000
(
04:53
+0000)
committer
Richard Stallman
<rms@gnu.org>
Tue, 16 Mar 1993 04:53:55 +0000
(
04:53
+0000)
From-SVN: r3753
gcc/c-decl.c
patch
|
blob
|
history
diff --git
a/gcc/c-decl.c
b/gcc/c-decl.c
index e9b722dae09b6d5ac970d903c8357b88b1a4a524..80844596da8974f1470cf9941d173e4906588ab3 100644
(file)
--- 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