From 0285e5f217107a2906d12e2dbe9f0b97da82e9a0 Mon Sep 17 00:00:00 2001 From: Christian Prochaska Date: Tue, 16 May 2023 12:53:36 +0200 Subject: [PATCH] test-rm_fault: fix build error with `-std=gnu++20` Fixes #4891 --- repos/base/src/test/rm_fault/main.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/repos/base/src/test/rm_fault/main.cc b/repos/base/src/test/rm_fault/main.cc index f1a87e7317..16b81e813e 100644 --- a/repos/base/src/test/rm_fault/main.cc +++ b/repos/base/src/test/rm_fault/main.cc @@ -63,7 +63,9 @@ bool modify_at(addr_t addr) return false; if (value != READ_TEST + 1) { - addr_t value_mod = ++(*(addr_t volatile *)(addr)); + + (*(addr_t volatile *)(addr)) = (*(addr_t volatile *)(addr)) + 1; + addr_t value_mod = (*(addr_t volatile *)(addr)); /* if we are get told to stop, do so */ if (*(addr_t volatile *)(addr + sizeof(addr)) == STOP_TEST)