aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1993-03-12 23:17:41 +0000
committerRichard Stallman <rms@gnu.org>1993-03-12 23:17:41 +0000
commit80f9c711d9b7a26f898dd3bd4e6cea1e35ef2df6 (patch)
treed93392262e7f4bcc795564bb65c0d8d42bd68d70
parentc841050eed727c249d687a85c2e991d971cd1ff3 (diff)
downloadgcc-80f9c711d9b7a26f898dd3bd4e6cea1e35ef2df6.zip
gcc-80f9c711d9b7a26f898dd3bd4e6cea1e35ef2df6.tar.gz
gcc-80f9c711d9b7a26f898dd3bd4e6cea1e35ef2df6.tar.bz2
(variable_size): Better error for div by 0 in size.
From-SVN: r3722
-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 c86fc00..1224348 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);
}