From 80f9c711d9b7a26f898dd3bd4e6cea1e35ef2df6 Mon Sep 17 00:00:00 2001 From: Richard Stallman Date: Fri, 12 Mar 1993 23:17:41 +0000 Subject: [PATCH] (variable_size): Better error for div by 0 in size. From-SVN: r3722 --- gcc/stor-layout.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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); } -- 2.30.2