diff options
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r-- | gcc/c-decl.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 8320aca..d3bf142 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -3076,14 +3076,12 @@ set_array_declarator_inner (struct c_declarator *decl, static void add_flexible_array_elts_to_size (tree decl, tree init) { - unsigned int size; tree elt, type; - size = VEC_length (constructor_elt, CONSTRUCTOR_ELTS (init)); - if (size == 0) + if (VEC_empty (constructor_elt, CONSTRUCTOR_ELTS (init))) return; - elt = VEC_index (constructor_elt, CONSTRUCTOR_ELTS (init), size - 1)->value; + elt = VEC_last (constructor_elt, CONSTRUCTOR_ELTS (init))->value; type = TREE_TYPE (elt); if (TREE_CODE (type) == ARRAY_TYPE && TYPE_SIZE (type) == NULL_TREE |