X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=type.c;h=5c3da0064b8bd5af147464d8f0b35cd7403ce26e;hb=e41051da2d44beecea21b5e26f301f957dc16679;hp=c79f1c29024844303601b101c8dca2b10f6a602e;hpb=f7fcbd784cc31900ec3d73b4a523470a79475abd;p=cparser diff --git a/type.c b/type.c index c79f1c2..5c3da00 100644 --- a/type.c +++ b/type.c @@ -7,9 +7,10 @@ #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); @@ -189,7 +190,8 @@ static void print_array_type_post(const array_type_t *type) 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); @@ -883,7 +885,7 @@ type_t *skip_typeref(type_t *type) if(typeof_type->typeof_type != NULL) { type = typeof_type->typeof_type; } else { - type = typeof_type->expression->base.datatype; + type = typeof_type->expression->base.type; } continue; }