commit 01d01a1a25cb16603479e6e0a7ae3dbc7c726686 Author: Roberto E. Vargas Caballero <k...@shike2.com> AuthorDate: Sun Jan 10 11:30:33 2016 +0100 Commit: Roberto E. Vargas Caballero <k...@shike2.com> CommitDate: Sun Jan 10 11:30:33 2016 +0100
Initialize all the flags of new created types This change simplify the logic in mktype() diff --git a/cc1/types.c b/cc1/types.c index 0a23b9c..1607bd4 100644 --- a/cc1/types.c +++ b/cc1/types.c @@ -452,7 +452,9 @@ mktype(Type *tp, int op, TINT nelem, Type *pars[]) type.type = tp; type.op = op; + type.defined = 0; type.arith = 0; + type.sign = 0; type.integer = 0; type.printed = 0; type.aggreg = 0; @@ -465,7 +467,7 @@ mktype(Type *tp, int op, TINT nelem, Type *pars[]) switch (op) { case ARY: if (nelem == 0) - goto no_defined; + break; /* PASSTROUGH */ case FTN: case PTR: @@ -475,14 +477,11 @@ mktype(Type *tp, int op, TINT nelem, Type *pars[]) type.printed = 1; type.integer = 1; type.arith = 1; - type.sign = 0; type.n.rank = RANK_INT; - goto no_defined; + break; case STRUCT: case UNION: type.aggreg = 1; - no_defined: - type.defined = 0; break; }