[m-rev.] for review 4/4: Fix regtest

Paul Bone paul at bone.id.au
Fri Mar 17 14:21:30 AEDT 2023


Avoid compilation warnings that make the output of regtest noisy.

runtime/machdeps/regtest.c:
runtime/machdeps/regtest2.c:
    As above.
---
 runtime/machdeps/regtest.c  | 8 ++++++--
 runtime/machdeps/regtest2.c | 8 ++++++--
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/runtime/machdeps/regtest.c b/runtime/machdeps/regtest.c
index c967932fa..7a139112a 100644
--- a/runtime/machdeps/regtest.c
+++ b/runtime/machdeps/regtest.c
@@ -68,10 +68,14 @@ do {						\
 	fprintf(f, "Hello, world %d\n", i);	\
 	x = sin(x);				\
 	x = pow(x,1.5);				\
-	malloc(100);				\
+	if (!malloc(100)) {			\
+		abort();				\
+	}							\
 	call_func_with_args(1,2,3,4,5,6,7,8,10.0,20.0,30.0,40.0); \
 	extern_call_func_with_args(1,2,3,4,5,6,7,8,10.0,20.0,30.0,40.0); \
-	system("/bin/true");			\
+	if (system("/bin/true")) { 	\
+		abort();				\
+	}							\
 } while (0)
 
 static void 
diff --git a/runtime/machdeps/regtest2.c b/runtime/machdeps/regtest2.c
index caa895b89..a5c7a0834 100644
--- a/runtime/machdeps/regtest2.c
+++ b/runtime/machdeps/regtest2.c
@@ -56,9 +56,13 @@ do {						\
 	x = sin(x + global);			\
 	global = (int) x;			\
 	x = pow(x,1.5);				\
-	malloc(100);				\
+	if (!malloc(100)) { 		\
+		abort();				\
+	} 							\
 	extern_call_func_with_args(1,2,3,4,5,6,7,8,10.0,20.0,30.0,40.0); \
-	system("/bin/true");			\
+	if (system("/bin/true")) {  \
+		abort();				\
+	}							\
 } while (0)
 
 void 
-- 
2.25.1



More information about the reviews mailing list