]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
regtest warnings: fix unused returns and missing noexcept specifiers
authorPaul Floyd <pjfloyd@wanadoo.fr>
Mon, 26 May 2025 20:02:35 +0000 (22:02 +0200)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Mon, 26 May 2025 20:02:35 +0000 (22:02 +0200)
GCC 15.1.1 is still giving a -Walloc-size-larger-than= warning for
memcheck calloc-overflow.c

drd/tests/timed_mutex.cpp
massif/tests/overloaded-new.cpp

index fa7464ea5b1e53ba0a3f3dfd2b6926ea0d87e30f..97ac32096420a0510669a27aa49f60bf55c1d230 100644 (file)
@@ -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();
index 5ad92894e9d66ced732c2461d22e135892f42ff3..edea12b742bdc151163952fbdd0b374a599e1e36 100644 (file)
@@ -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
 {
 
 }