From: Paul Floyd Date: Mon, 26 May 2025 20:02:35 +0000 (+0200) Subject: regtest warnings: fix unused returns and missing noexcept specifiers X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=988d80f0e7789b6d04734125ef340db282da7322;p=thirdparty%2Fvalgrind.git 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 --git a/drd/tests/timed_mutex.cpp b/drd/tests/timed_mutex.cpp index fa7464ea5..97ac32096 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 5ad92894e..edea12b74 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 { }