Skip to content

Commit 5b8162f

Browse files
committed
CCUtil: Define virtual destructor in .cpp file
This fixes compiler warnings from clang: src/ccutil/ccutil.h:51:7: warning: 'CCUtil' has no out-of-line virtual method definitions; its vtable will be emitted in every translation unit [-Wweak-vtables] Signed-off-by: Stefan Weil <[email protected]>
1 parent 14c23c9 commit 5b8162f

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/ccutil/ccutil.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ CCUtil::CCUtil() :
2727
" whether to adapt to a character", &params_) {
2828
}
2929

30+
// Destructor.
31+
// It is defined here, so the compiler can create a single vtable
32+
// instead of weak vtables in every compilation unit.
33+
CCUtil::~CCUtil() = default;
34+
3035
CCUtilMutex::CCUtilMutex() {
3136
#ifdef _WIN32
3237
mutex_ = CreateMutex(0, FALSE, 0);

src/ccutil/ccutil.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class CCUtilMutex {
5151
class CCUtil {
5252
public:
5353
CCUtil();
54-
virtual ~CCUtil() = default;
54+
virtual ~CCUtil();
5555

5656
public:
5757
// Read the arguments and set up the data path.

0 commit comments

Comments
 (0)