code: plan9front

Download patch

ref: 032d64429f21143141dfa9646a73dfe6f1008b3b
parent: 27d3b4682ffd297e72120577a66c424ca0644cc5
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Fri Dec 2 19:05:43 EST 2022

cc: fix vlong->VOID cast (thanks cosa)

void main() { unsigned long long a; long long b; (void)(a=b);}

a.c:1 unknown vlong->VOID cast

with patch:

term% /sys/src/cmd/5c/6.out -S a.c
	TEXT	main+0(SB),0,$16
	MOVW	b-16(SP),R1
	MOVW	b-12(SP),R2
	MOVW	R1,a-8(SP)
	MOVW	R2,a-4(SP)
	RET	,
	END	,

--- a/sys/src/cmd/cc/com64.c
+++ b/sys/src/cmd/cc/com64.c
@@ -435,6 +435,8 @@
 			if(machcap(n))
 				return 1;
 			switch(n->type->etype) {
+			case TVOID:
+				return 1;
 			case TDOUBLE:
 				if(l->type->etype == TUVLONG)
 					a = noduv2d;