]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3991] Added comments about cppcheck suppressions
authorFrancis Dupont <fdupont@isc.org>
Tue, 26 May 2026 09:04:05 +0000 (11:04 +0200)
committerFrancis Dupont <fdupont@isc.org>
Wed, 27 May 2026 20:03:02 +0000 (22:03 +0200)
src/lib/asiolink/io_service_thread_pool.cc
src/lib/asiolink/unix_domain_socket.cc
src/lib/util/thread_pool.h
src/lib/util/unlock_guard.h

index 5146c83b730a53a61f72b5ca03ca207d78b8c3cd..b6c5e3b1ef45c59b1cae12a2ccda61431c29430f 100644 (file)
@@ -47,6 +47,10 @@ IoServiceThreadPool::IoServiceThreadPool(IOServicePtr io_service, size_t pool_si
     }
 }
 
+// This destructor throws (when it must not) when called by a thread
+// which is not the main one (e.g. a worker thread). This can't happen
+// but static analyzers e.g. cppcheck do not know this so they complain.
+// cppcheck-suppress throwInNoexceptFunction
 IoServiceThreadPool::~IoServiceThreadPool() {
     stop();
 }
index 8aec9b5610348f75e793c296c3c6607197ac5312..18c1f48a05437935d33dfeeeef8240dce61f7008 100644 (file)
@@ -32,6 +32,7 @@ public:
     /// @brief Destructor.
     ///
     /// Closes the socket.
+    // cppcheck-suppress throwInNoexceptFunction
     ~UnixDomainSocketImpl() {
         close();
     }
index 39acc4b613bed1e547bab44574d8ffe00aec3ba6..926bf0457b722cda2618f98120fdf99ce0806d73 100644 (file)
@@ -49,6 +49,11 @@ struct ThreadPool {
     }
 
     /// @brief Destructor
+    ///
+    /// This destructor throws (when it must not) when called by a thread
+    /// which is not the main one (e.g. a worker thread). This can't happen
+    /// but static analyzers e.g. cppcheck do not know this so they complain.
+    // cppcheck-suppress throwInNoexceptFunction
     ~ThreadPool() {
         reset();
     }
index 30be51486c8713d6815462d56b7bc1d16efa1712..5cb49fc9784c9b34cf447e442c2644d3e0c7adea 100644 (file)
@@ -32,6 +32,7 @@ public:
     /// @brief Destructor.
     ///
     /// Lock mutex object on destructor.
+    // cppcheck-suppress throwInNoexceptFunction
     ~UnlockGuard() {
         lock_.lock();
     }