aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@gcc.gnu.org>2000-11-19 15:40:37 -0800
committerRichard Henderson <rth@gcc.gnu.org>2000-11-19 15:40:37 -0800
commita25f12118ff98fe7983907767398ef77c609cc17 (patch)
treeb0963851524845509cecfbe1ac8dbb68d8f147ff /gcc/tree.c
parent2650255a57477be0a966f3d3af0c0b71a0e52f0f (diff)
downloadgcc-a25f12118ff98fe7983907767398ef77c609cc17.zip
gcc-a25f12118ff98fe7983907767398ef77c609cc17.tar.gz
gcc-a25f12118ff98fe7983907767398ef77c609cc17.tar.bz2
c-decl.c (grokdeclarator): Support flexible array members.
* c-decl.c (grokdeclarator): Support flexible array members. Use open-ended ranges for these and zero-length arrays. * c-typeck.c (push_init_level): Validate the context of initialization of a zero-length array. * tree.c (int_fits_type_p): Be prepared for missing bounds. * varasm.c (array_size_for_constructor): New. (output_constructor): Use it for arrays of unspecified length. * extend.texi (Zero Length): Mention C99 flexible array members. Document initialization in a top-level struct as valid. From-SVN: r37576
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 7652052..7910449 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -4186,7 +4186,9 @@ int_fits_type_p (c, type)
{
/* If the bounds of the type are integers, we can check ourselves.
Otherwise,. use force_fit_type, which checks against the precision. */
- if (TREE_CODE (TYPE_MAX_VALUE (type)) == INTEGER_CST
+ if (TYPE_MAX_VALUE (type) != NULL_TREE
+ && TYPE_MIN_VALUE (type) != NULL_TREE
+ && TREE_CODE (TYPE_MAX_VALUE (type)) == INTEGER_CST
&& TREE_CODE (TYPE_MIN_VALUE (type)) == INTEGER_CST)
{
if (TREE_UNSIGNED (type))