Examples of errors detected by the V670 diagnostic

V670. An uninitialized class member is used to initialize another member. Remember that members are initialized in the order of their declarations inside a class.


Tesseract

V670 The uninitialized class member 'fontinfo_table_' is used to initialize the 'samples_' member. Remember that members are initialized in the order of their declarations inside a class. libtesseract303 mastertrainer.cpp 58


class MasterTrainer {
  ....
  TrainingSampleSet samples_;
  ....
  FontInfoTable fontinfo_table_;
  ....
};

MasterTrainer::MasterTrainer(NormalizationMode norm_mode,
                             bool shape_analysis,
                             bool replicate_samples,
                             int debug_level)
  : norm_mode_(norm_mode),
    samples_(fontinfo_table_),
    junk_samples_(fontinfo_table_),
    verify_samples_(fontinfo_table_),
    charsetsize_(0),
    enable_shape_anaylsis_(shape_analysis),
    enable_replication_(replicate_samples),
    fragments_(NULL), prev_unichar_id_(-1),
    debug_level_(debug_level) {
}

Identical errors can be found in some other places:

  • V670 The uninitialized class member 'fontinfo_table_' is used to initialize the 'junk_samples_' member. Remember that members are initialized in the order of their declarations inside a class. libtesseract303 mastertrainer.cpp 59
  • V670 The uninitialized class member 'fontinfo_table_' is used to initialize the 'verify_samples_' member. Remember that members are initialized in the order of their declarations inside a class. libtesseract303 mastertrainer.cpp 59

.NET CoreCLR

V670 The uninitialized class member 'gcInfo' is used to initialize the 'regSet' member. Remember that members are initialized in the order of their declarations inside a class. ClrJit codegencommon.cpp 92


CodeGenInterface *getCodeGenerator(Compiler *comp);

class CodeGenInterface
{
    friend class emitter;

public:
    ....
    RegSet  regSet; // <= line 91
    ....
public:
    GCInfo  gcInfo; // <= line 322
....
};

// CodeGen constructor
CodeGenInterface::CodeGenInterface(Compiler* theCompiler) :
    compiler(theCompiler),
    gcInfo(theCompiler),
    regSet(theCompiler, gcInfo)
{
}

Unreal Engine 4

V670 The uninitialized class member 'bShouldThrottle' is used to initialize the 'CVarAllowThrottle' member. Remember that members are initialized in the order of their declarations inside a class. throttlemanager.cpp 10


class SLATECORE_API FSlateThrottleManager
{
  ....
  FAutoConsoleVariableRef CVarAllowThrottle;

  int32 bShouldThrottle;
};

FSlateThrottleManager::FSlateThrottleManager( )
  : CVarAllowThrottle(TEXT("Slate.bAllowThrottling"),
    bShouldThrottle, TEXT("....") )
  , bShouldThrottle(1)
  , ThrottleCount(0)
{ }

Identical errors can be found in some other places:

  • V670 The uninitialized class member 'Bytes' is used to initialize the 'Writer' member. Remember that members are initialized in the order of their declarations inside a class. reloadobjectarc.cpp 6
  • V670 The uninitialized class member 'Bytes' is used to initialize the 'Reader' member. Remember that members are initialized in the order of their declarations inside a class. reloadobjectarc.cpp 6
  • V670 The uninitialized class member 'SerializedObjectData' is used to initialize the 'MemoryWriter' member. Remember that members are initialized in the order of their declarations inside a class. archiveobjectcrc32.cpp 14
  • And 1 additional diagnostic messages.

Appleseed

V670 The uninitialized class member 'm_s0_cache' is used to initialize the 'm_s1_element_swapper' member. Remember that members are initialized in the order of their declarations inside a class. animatecamera cache.h 1009


class DualStageCache
  : public NonCopyable
{
  ....
    S1ElementSwapper    m_s1_element_swapper;     // <= line 679
    S1Cache             m_s1_cache;

    S0ElementSwapper    m_s0_element_swapper;
    S0Cache             m_s0_cache;               // <= line 683
};

FOUNDATION_DSCACHE_TEMPLATE_DEF(APPLESEED_EMPTY)
DualStageCache(
    KeyHasherType&      key_hasher,
    ElementSwapperType& element_swapper,
    const KeyType&      invalid_key,
    AllocatorType       allocator)
  : m_s1_element_swapper(m_s0_cache, element_swapper)
  , m_s1_cache(m_s1_element_swapper, allocator)
  , m_s0_element_swapper(m_s1_cache)
  , m_s0_cache(key_hasher, m_s0_element_swapper, invalid_key)
{
}

Mozilla Thunderbird

V670 The uninitialized class member 'mWorkerConnection' is used to initialize the 'mWorkerStatements' member. Remember that members are initialized in the order of their declarations inside a class. domstoragedbthread.cpp 50


DOMStorageDBThread::DOMStorageDBThread()
: mWorkerStatements(mWorkerConnection)
, ....
{}

class DOMStorageDBThread final : public DOMStorageDBBridge
{
private:
  ....
  StatementCache mWorkerStatements;                 // <=line 304
  ....
  nsCOMPtr<mozIStorageConnection> mWorkerConnection;// <=line 309
  ....
}

Identical errors can be found in some other places:

  • V670 The uninitialized class member 'mReaderConnection' is used to initialize the 'mReaderStatements' member. Remember that members are initialized in the order of their declarations inside a class. domstoragedbthread.cpp 51


Do you make errors in the code?

Check your code
with PVS-Studio

Static code analysis
for C, C++ and C#

goto PVS-Studio;