Skip to content

Commit a8e7ef6

Browse files
committed
[#3991] Added comments about cppcheck suppressions
1 parent 0334ac5 commit a8e7ef6

4 files changed

Lines changed: 11 additions & 0 deletions

File tree

src/lib/asiolink/io_service_thread_pool.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ IoServiceThreadPool::IoServiceThreadPool(IOServicePtr io_service, size_t pool_si
4747
}
4848
}
4949

50+
// This destructor throws (when it must not) when called by a thread
51+
// which is not the main one (e.g. a worker thread). This can't happen
52+
// but static analyzers e.g. cppcheck do not know this so they complain.
53+
// cppcheck-suppress throwInNoexceptFunction
5054
IoServiceThreadPool::~IoServiceThreadPool() {
5155
stop();
5256
}

src/lib/asiolink/unix_domain_socket.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class UnixDomainSocketImpl : public boost::enable_shared_from_this<UnixDomainSoc
3232
/// @brief Destructor.
3333
///
3434
/// Closes the socket.
35+
// cppcheck-suppress throwInNoexceptFunction
3536
~UnixDomainSocketImpl() {
3637
close();
3738
}

src/lib/util/thread_pool.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ struct ThreadPool {
4949
}
5050

5151
/// @brief Destructor
52+
///
53+
/// This destructor throws (when it must not) when called by a thread
54+
/// which is not the main one (e.g. a worker thread). This can't happen
55+
/// but static analyzers e.g. cppcheck do not know this so they complain.
56+
// cppcheck-suppress throwInNoexceptFunction
5257
~ThreadPool() {
5358
reset();
5459
}

src/lib/util/unlock_guard.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class UnlockGuard : public boost::noncopyable {
3232
/// @brief Destructor.
3333
///
3434
/// Lock mutex object on destructor.
35+
// cppcheck-suppress throwInNoexceptFunction
3536
~UnlockGuard() {
3637
lock_.lock();
3738
}

0 commit comments

Comments
 (0)