shithub: riscv

Download patch

ref: b0a059537147237e868b4a8f07922ae8a349e55c
parent: 025a2d172ebfe36bc0da32f5712dd250916c73f1
author: Jacob Moody <moody@posixcafe.org>
date: Sat May 11 20:26:37 EDT 2024

power64: refactor va_arg in u.h to fix warnings

Bring over conventions from other archs.
This issue shows up when you don't put va_end,
which our systemcall handlers are guilty of.

--- a/power64/include/u.h
+++ b/power64/include/u.h
@@ -84,9 +84,9 @@
 	USED(list)
 #define va_arg(list, mode)\
 	((sizeof(mode) == 1)?\
-		((mode*)(list += 8))[-1]:\
+		((list += 8), (mode*)list)[-1]:\
 	(sizeof(mode) == 2)?\
-		((mode*)(list += 8))[-1]:\
+		((list += 8), (mode*)list)[-1]:\
 	(sizeof(mode) == 4)?\
-		((mode*)(list += 8))[-1]:\
-		((mode*)(list += sizeof(mode)))[-1])
+		((list += 8), (mode*)list)[-1]:\
+		((list += sizeof(mode)), (mode*)list)[-1])