From: Alan Modra Date: Tue, 9 Dec 2025 07:25:12 +0000 (+1030) Subject: gold testsuite volatile fixes X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f8b635b0c6ecd29a5eb55e970f75c04a4df95ef4;p=thirdparty%2Fbinutils-gdb.git gold testsuite volatile fixes Avoid these mainline gcc complaints (C23 WG14 n2743). copy_test_relro.cc:42:5: error: ‘++’ expression of ‘volatile’-qualified type is deprecated [-Werror=volatile] icf_test_pr21066.cc:50:55: error: ‘volatile’-qualified parameter is deprecated [-Werror=volatile] * testsuite/copy_test_relro.cc (segv): Avoid gcc warning. * testsuite/icf_test_pr21066.cc (capture_exception_of_type): Likewise. --- diff --git a/gold/testsuite/copy_test_relro.cc b/gold/testsuite/copy_test_relro.cc index c2a734d29bb..6cc1d350979 100644 --- a/gold/testsuite/copy_test_relro.cc +++ b/gold/testsuite/copy_test_relro.cc @@ -39,7 +39,7 @@ sigjmp_buf jmp; void segv(int) { - ++segfaults; + segfaults = segfaults + 1; siglongjmp(jmp, 1); } diff --git a/gold/testsuite/icf_test_pr21066.cc b/gold/testsuite/icf_test_pr21066.cc index 2b6c4da0ef0..33e52780f82 100644 --- a/gold/testsuite/icf_test_pr21066.cc +++ b/gold/testsuite/icf_test_pr21066.cc @@ -47,10 +47,11 @@ void raise_second_exception() } template -void capture_exception_of_type(volatile callback_fn_t f) +void capture_exception_of_type(callback_fn_t f) { + volatile callback_fn_t vf = f; try { - f(); + vf(); } catch (E& e) { puts("caught expected exception"); } catch (...) {