summaryrefslogtreecommitdiff
path: root/gcc/stor-layout.c
diff options
context:
space:
mode:
authorrms <rms@138bc75d-0d04-0410-961f-82ee72b054a4>1993-03-12 23:17:41 +0000
committerrms <rms@138bc75d-0d04-0410-961f-82ee72b054a4>1993-03-12 23:17:41 +0000
commitd83fb78152dfbb8db3b6c425c5921a93ea70b24e (patch)
treed93392262e7f4bcc795564bb65c0d8d42bd68d70 /gcc/stor-layout.c
parent4634c15dedf5f3ba4a20d31510a7b5ad5ecbd5ae (diff)
downloadgcc-d83fb78152dfbb8db3b6c425c5921a93ea70b24e.tar.gz
(variable_size): Better error for div by 0 in size.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@3722 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/stor-layout.c')
-rw-r--r--gcc/stor-layout.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c
index c86fc004e28..1224348a034 100644
--- a/gcc/stor-layout.c
+++ b/gcc/stor-layout.c
@@ -81,7 +81,11 @@ variable_size (size)
if (global_bindings_p ())
{
- error ("variable-size type declared outside of any function");
+ if (TREE_CONSTANT (size))
+ error ("type size can't be explicitly evaluated");
+ else
+ error ("variable-size type declared outside of any function");
+
return size_int (1);
}