Unified · Split
| @@ -3169,6 +3169,8 @@ static void post_type(CType *type, AttributeDef *ad) · 3168 unmodified lines | ||
| 3169 | 3169 | n = vtop->c.i; |
| 3170 | 3170 | if (n < 0) |
| 3171 | 3171 | error("invalid array size"); |
| 3172 | + } else if (!local_stack) { | |
| 3173 | + error("expected constant expression (variably modified array at file scope)"); | |
| 3172 | 3174 | } else { |
| 3173 | 3175 | if (!is_integer_btype(vtop->type.t & VT_BTYPE)) |
| 3174 | 3176 | error("size of variable length array should be an integer"); |