shithub: scc

Download patch

ref: 01d01a1a25cb16603479e6e0a7ae3dbc7c726686
parent: 8a1556967443af2e55ef33b3cdab613acbc0ef91
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Sun Jan 10 06:30:33 EST 2016

Initialize all the flags of new created types

This change simplify the logic in mktype()

--- a/cc1/types.c
+++ b/cc1/types.c
@@ -452,7 +452,9 @@
 
 	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 @@
 	switch (op) {
 	case ARY:
 		if (nelem == 0)
-			goto no_defined;
+			break;
 		/* PASSTROUGH */
 	case FTN:
 	case PTR:
@@ -475,14 +477,11 @@
 		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;
 	}