code: plan9front

Download patch

ref: e8b8cec9c7ce157a67a22a84a5716e271245d049
parent: a8834acf73c4c5bfa337fd3fb1ffc82151423a54
author: Michael Forney <mforney@mforney.org>
date: Sat Jan 23 13:28:08 EST 2021

[9front] cc: fix comparison warning with constant LHS
This prevents an incorrect warning for a comparison such as `0 < x`,
where x is an unsigned type.  Previously, this would get normalized as
`x >= 0` rather than `x > 0` when checking the comparison.

--- a/sys/src/cmd/cc/com.c
+++ b/sys/src/cmd/cc/com.c
@@ -1392,7 +1392,7 @@
 	if(reverse){
 		r = n->left;
 		l = n->right;
-		op = comrel[relindex(n->op)];
+		op = invrel[relindex(n->op)];
 	}else{
 		l = n->left;
 		r = n->right;