git: 9front

Download patch

ref: ea8e8b255ec88b51af31be5c01de8f55fd4c2e8a
parent: 595093a600f3f894dec4ee8dc99f70bafc4c573d
author: aiju <devnull@localhost>
date: Sat Dec 1 06:39:49 EST 2018

kencc: turn "function args not checked" warning into "function not declared" error if appropriate

--- a/sys/src/cmd/cc/com.c
+++ b/sys/src/cmd/cc/com.c
@@ -607,11 +607,14 @@
 		if(o | tcoma(l, r, l->type->down, 1))
 			goto bad;
 		n->type = l->type->link;
-		if(!debug['B'])
-			if(l->type->down == T || l->type->down->etype == TOLD) {
+		if(!debug['B']){
+			if(l->type->down == T)
+				diag(n, "function not declared: %F", l);
+			else if(l->type->down->etype == TOLD) {
 				nerrors--;
 				diag(n, "function args not checked: %F", l);
 			}
+		}
 		dpcheck(n);
 		break;
 
--