Skip to content

Commit

Permalink
CCStruct: Define virtual destructor in .cpp file
Browse files Browse the repository at this point in the history
This fixes compiler warnings from clang:

src/ccstruct/ccstruct.h:25:7: warning:
 'CCStruct' has no out-of-line virtual method definitions;
 its vtable will be emitted in every translation unit [-Wweak-vtables]

Signed-off-by: Stefan Weil <sw@weilnetz.de>
  • Loading branch information
stweil committed Sep 4, 2018
1 parent 8317371 commit bde8f08
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/ccstruct/ccstruct.cpp
Expand Up @@ -28,4 +28,9 @@ const double CCStruct::kAscenderFraction = 0.25;
const double CCStruct::kXHeightCapRatio = CCStruct::kXHeightFraction /
(CCStruct::kXHeightFraction + CCStruct::kAscenderFraction);

// Destructor.
// It is defined here, so the compiler can create a single vtable
// instead of weak vtables in every compilation unit.
CCStruct::~CCStruct() = default;

}
2 changes: 1 addition & 1 deletion src/ccstruct/ccstruct.h
Expand Up @@ -25,7 +25,7 @@ namespace tesseract {
class CCStruct : public CUtil {
public:
CCStruct() = default;
~CCStruct() = default;
virtual ~CCStruct();

// Globally accessible constants.
// APPROXIMATIONS of the fractions of the character cell taken by
Expand Down

0 comments on commit bde8f08

Please sign in to comment.