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