panic("invalid initializer type");
}
- array_type->size = cnst;
+ array_type->size = cnst;
+ array_type->has_implicit_size = true;
}
}
#include "adt/error.h"
static struct obstack _type_obst;
-struct obstack *type_obst = &_type_obst;
static FILE *out;
-static int type_visited = 0;
+struct obstack *type_obst = &_type_obst;
+static int type_visited = 0;
+static bool print_implicit_array_size = true;
static void intern_print_type_pre(const type_t *type, bool top);
static void intern_print_type_post(const type_t *type, bool top);
fputs("static ", out);
}
print_type_qualifiers(type->type.qualifiers);
- if(type->size != NULL) {
+ if(type->size != NULL
+ && (print_implicit_array_size || !type->has_implicit_size)) {
print_expression(type->size);
}
fputc(']', out);
type_base_t type;
type_t *element_type;
expression_t *size;
- bool is_static;
- bool is_variable;
+ unsigned is_static : 1;
+ unsigned is_variable : 1;
+ unsigned has_implicit_size : 1;
};
struct function_parameter_t {