shithub: scc

Download patch

ref: 15c8ffc688a52d0596cbd9a27a1dd30aa51c0118
parent: 34661e518cba898aeef5ce3db074942411dbbe21
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Fri May 20 11:23:57 EDT 2016

[cc1] Do not recover in incorrect return type

In this case we don't have to recover the error,
we can continue with the parsing without problems
here.

--- a/cc1/stmt.c
+++ b/cc1/stmt.c
@@ -158,7 +158,7 @@
 		if (tp == voidtype)
 			warn("function returning void returns a value");
 		else if ((np = convert(np, tp, 0)) == NULL)
-			error("incorrect type in return");
+			errorp("incorrect type in return");
 	}
 	emit(ORET, NULL);
 	emit(OEXPR, np);