shithub: riscv

Download patch

ref: 4fd09def0fc51d0606e677f1ab59ad695d1cd780
parent: 759aafa007c42dce044800863455ad6048ed0ba5
author: cinap_lenrek <[email protected]>
date: Sat Jun 26 09:16:36 EDT 2021

kencc: revert back to "set but not used"

The change to "assignment not used" breaks symmetry with
"used and not set" and removes the reference to the
specific warning mentioned in /sys/doc/comp.ms.

Also, the patch was half-assed as that it left some typos
in like "used an not set", which this change also fixed.

--- a/sys/src/cmd/1c/reg.c
+++ b/sys/src/cmd/1c/reg.c
@@ -359,9 +359,9 @@
 			  ~(r->refahead.b[z] | r->calahead.b[z] | addrs.b[z]);
 		if(bany(&bit)) {
 			nearln = r->prog->lineno;
-			warn(Z, "assignment not used: %B", bit);
+			warn(Z, "set and not used: %B", bit);
 			if(debug['R'])
-				print("set an not used: %B\n", bit);
+				print("set and not used: %B\n", bit);
 			excise(r);
 		}
 		for(z=0; z<BITS; z++)
--- a/sys/src/cmd/2c/reg.c
+++ b/sys/src/cmd/2c/reg.c
@@ -359,9 +359,9 @@
 			  ~(r->refahead.b[z] | r->calahead.b[z] | addrs.b[z]);
 		if(bany(&bit)) {
 			nearln = r->prog->lineno;
-			warn(Z, "assignment not used: %B", bit);
+			warn(Z, "set and not used: %B", bit);
 			if(debug['R'])
-				print("assignment not used: %B\n", bit);
+				print("set and not used: %B\n", bit);
 			excise(r);
 		}
 		for(z=0; z<BITS; z++)
--- a/sys/src/cmd/5c/reg.c
+++ b/sys/src/cmd/5c/reg.c
@@ -329,9 +329,9 @@
 			  ~(r->refahead.b[z] | r->calahead.b[z] | addrs.b[z]);
 		if(bany(&bit)) {
 			nearln = r->prog->lineno;
-			warn(Z, "assignment not used: %B", bit);
+			warn(Z, "set and not used: %B", bit);
 			if(debug['R'])
-				print("assignment not used: %B\n", bit);
+				print("set and not used: %B\n", bit);
 			excise(r);
 		}
 		for(z=0; z<BITS; z++)
--- a/sys/src/cmd/6c/reg.c
+++ b/sys/src/cmd/6c/reg.c
@@ -520,9 +520,9 @@
 			  ~(r->refahead.b[z] | r->calahead.b[z] | addrs.b[z]);
 		if(bany(&bit)) {
 			nearln = r->prog->lineno;
-			warn(Z, "assignment not used: %B", bit);
+			warn(Z, "set and not used: %B", bit);
 			if(debug['R'])
-				print("assignment not used: %B\n", bit);
+				print("set and not used: %B\n", bit);
 			excise(r);
 		}
 		for(z=0; z<BITS; z++)
--- a/sys/src/cmd/7c/reg.c
+++ b/sys/src/cmd/7c/reg.c
@@ -324,9 +324,9 @@
 			  ~(r->refahead.b[z] | r->calahead.b[z] | addrs.b[z]);
 		if(bany(&bit)) {
 			nearln = r->prog->lineno;
-			warn(Z, "assignment not used: %B", bit);
+			warn(Z, "set and not used: %B", bit);
 			if(debug['R'])
-				print("assignment not used: %B\n", bit);
+				print("set and not used: %B\n", bit);
 			excise(r);
 		}
 		for(z=0; z<BITS; z++)
--- a/sys/src/cmd/8c/reg.c
+++ b/sys/src/cmd/8c/reg.c
@@ -451,9 +451,9 @@
 			  ~(r->refahead.b[z] | r->calahead.b[z] | addrs.b[z]);
 		if(bany(&bit)) {
 			nearln = r->prog->lineno;
-			warn(Z, "assignment not used: %B", bit);
+			warn(Z, "set and not used: %B", bit);
 			if(debug['R'])
-				print("assignment not used: %B\n", bit);
+				print("set and not used: %B\n", bit);
 			excise(r);
 		}
 		for(z=0; z<BITS; z++)
--- a/sys/src/cmd/kc/reg.c
+++ b/sys/src/cmd/kc/reg.c
@@ -307,9 +307,9 @@
 			  ~(r->refahead.b[z] | r->calahead.b[z] | addrs.b[z]);
 		if(bany(&bit)) {
 			nearln = r->prog->lineno;
-			warn(Z, "assignment not used: %B", bit);
+			warn(Z, "set and not used: %B", bit);
 			if(debug['R'])
-				print("set an not used: %B\n", bit);
+				print("set and not used: %B\n", bit);
 			excise(r);
 		}
 		for(z=0; z<BITS; z++)
--- a/sys/src/cmd/qc/reg.c
+++ b/sys/src/cmd/qc/reg.c
@@ -317,9 +317,9 @@
 			  ~(r->refahead.b[z] | r->calahead.b[z] | addrs.b[z]);
 		if(bany(&bit)) {
 			nearln = r->prog->lineno;
-			warn(Z, "assignment not used: %B", bit);
+			warn(Z, "set and not used: %B", bit);
 			if(debug['R'])
-				print("set an not used: %B\n", bit);
+				print("set and not used: %B\n", bit);
 			excise(r);
 		}
 		for(z=0; z<BITS; z++)
--- a/sys/src/cmd/vc/reg.c
+++ b/sys/src/cmd/vc/reg.c
@@ -319,9 +319,9 @@
 			  ~(r->refahead.b[z] | r->calahead.b[z] | addrs.b[z]);
 		if(bany(&bit)) {
 			nearln = r->prog->lineno;
-			warn(Z, "assignment not used: %B", bit);
+			warn(Z, "set and not used: %B", bit);
 			if(debug['R'])
-				print("assignment not used: %B\n", bit);
+				print("set and not used: %B\n", bit);
 			excise(r);
 		}
 		for(z=0; z<BITS; z++)