shithub: scc

Download patch

ref: adb48e8988aad7d39acdeeb413e99fb4951695af
parent: e35c19c1a268f0d66bdb676a5e576da8b5e8d177
author: Roberto E. Vargas Caballero <[email protected]>
date: Tue Aug 25 11:23:22 EDT 2015

Do not recover in semantic errors

They don't need recover anything.

--- a/cc1/decl.c
+++ b/cc1/decl.c
@@ -731,9 +731,9 @@
 		case TQUALIFIER:
 		case SCLASS:
 			if (sym->token == TYPEIDEN)
-				error("function definition declared 'typedef'");
+				errorp("function definition declared 'typedef'");
 			if (sym->flags & ISDEFINED)
-				error("redefinition of '%s'", sym->name);
+				errorp("redefinition of '%s'", sym->name);
 			if (sym->flags & ISEXTERN) {
 				sym->flags &= ~ISEXTERN;
 				sym->flags |= ISGLOBAL;
--- a/cc1/expr.c
+++ b/cc1/expr.c
@@ -508,10 +508,10 @@
 			warn("comparision between different pointer types");
 		break;
 	default:
-		error("incompatibles type in comparision");
+		errorp("incompatibles type in comparision");
 	}
 
-	return node(op, lp->type, lp, rp);
+	return node(op, inttype, lp, rp);
 }
 
 static Node *
@@ -537,7 +537,7 @@
 		return pcompare(op, lp, rp);
 	default:
 	nocompat:
-		error("incompatibles type in comparision");
+		errorp("incompatibles type in comparision");
 	}
 
 	return simplify(op, inttype, lp, rp);