From: Paul F. <pa...@so...> - 2025-05-26 20:05:54
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=988d80f0e7789b6d04734125ef340db282da7322 commit 988d80f0e7789b6d04734125ef340db282da7322 Author: Paul Floyd <pj...@wa...> Date: Mon May 26 22:02:35 2025 +0200 regtest warnings: fix unused returns and missing noexcept specifiers GCC 15.1.1 is still giving a -Walloc-size-larger-than= warning for memcheck calloc-overflow.c Diff: --- drd/tests/timed_mutex.cpp | 4 ++-- massif/tests/overloaded-new.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drd/tests/timed_mutex.cpp b/drd/tests/timed_mutex.cpp index fa7464ea5b..97ac320964 100644 --- a/drd/tests/timed_mutex.cpp +++ b/drd/tests/timed_mutex.cpp @@ -10,7 +10,7 @@ int global; void f() { auto now=std::chrono::steady_clock::now(); - test_mutex.try_lock_until(now + std::chrono::seconds(11)); + (void)test_mutex.try_lock_until(now + std::chrono::seconds(11)); --global; std::this_thread::sleep_for(std::chrono::seconds(1)); test_mutex.unlock(); @@ -23,7 +23,7 @@ int main() std::thread t(f); std::this_thread::sleep_for(std::chrono::seconds(1)); auto now=std::chrono::steady_clock::now(); - test_mutex.try_lock_until(now + std::chrono::seconds(11)); + (void)test_mutex.try_lock_until(now + std::chrono::seconds(11)); ++global; test_mutex.unlock(); t.join(); diff --git a/massif/tests/overloaded-new.cpp b/massif/tests/overloaded-new.cpp index 5ad92894e9..edea12b742 100644 --- a/massif/tests/overloaded-new.cpp +++ b/massif/tests/overloaded-new.cpp @@ -19,7 +19,7 @@ __attribute__((noinline)) void* operator new (std::size_t n) return (void*)12345; } -__attribute__((noinline)) void* operator new (std::size_t n, std::nothrow_t const &) +__attribute__((noinline)) void* operator new (std::size_t n, std::nothrow_t const &) noexcept { return (void*)23456; } @@ -29,7 +29,7 @@ __attribute__((noinline)) void* operator new[] (std::size_t n) return (void*)34567; } -__attribute__((noinline)) void* operator new[] (std::size_t n, std::nothrow_t const &) +__attribute__((noinline)) void* operator new[] (std::size_t n, std::nothrow_t const &) noexcept { return (void*)45678; } @@ -54,12 +54,12 @@ __attribute__((noinline)) void* operator new[](std::size_t size, std::align_val_ return (void*)89012; } -__attribute__((noinline)) void operator delete (void* p) +__attribute__((noinline)) void operator delete (void* p) noexcept { } -__attribute__((noinline)) void operator delete[] (void* p) +__attribute__((noinline)) void operator delete[] (void* p) noexcept { } |