- case EXPR_CLASS_CONSTANT: {
- long const size = fold_constant_to_int(size_expression);
- array_type->array.size = size;
- array_type->array.size_constant = true;
- /* §6.7.5.2:1 If the expression is a constant expression, it shall
- * have a value greater than zero. */
- if (size <= 0) {
- if (size < 0 || !GNU_MODE) {
- errorf(&size_expression->base.source_position,
- "size of array must be greater than zero");
- } else if (warning.other) {
- warningf(&size_expression->base.source_position,
- "zero length arrays are a GCC extension");
- }
- }
- break;
+ case EXPR_CLASS_CONSTANT: {
+ long const size = fold_constant_to_int(size_expression);
+ array_type->array.size = size;
+ array_type->array.size_constant = true;
+ /* §6.7.5.2:1 If the expression is a constant expression,
+ * it shall have a value greater than zero. */
+ if (size < 0) {
+ errorf(&size_expression->base.source_position,
+ "size of array must be greater than zero");
+ } else if (size == 0 && !GNU_MODE) {
+ errorf(&size_expression->base.source_position,
+ "size of array must be greater than zero (zero length arrays are a GCC extension)");