shithub: riscv

Download patch

ref: b5f7e27f441cc6d5e30532fdd2d506a4f30f4a04
parent: a847d7a53d64b1f7d11eb3b969c2684ea0aa399b
author: aiju <devnull@localhost>
date: Sun Dec 2 06:36:58 EST 2018

kencc: make "function not declared" a warning unless compiling with -T

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