Examples of errors detected by the V670 diagnostic
V670. 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) {
}
Similar 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)
{ }
Similar 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
....
}
Similar 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
Rosegarden
V670 The uninitialized class member 'm_intervals' is used to initialize the 'm_size' member. Remember that members are initialized in the order of their declarations inside a class. Tuning.cpp 394
class Tuning {
....
int m_size; // line 138
const IntervalList *m_intervals; // line 139
....
}
Tuning::Tuning(const Tuning *tuning) :
m_name(tuning->getName()),
m_rootPitch(tuning->getRootPitch()),
m_refPitch(tuning->getRefPitch()),
m_size(m_intervals->size()),
m_intervals(tuning->getIntervalList()),
m_spellings(tuning->getSpellingList())
{
....
}
NCBI Genome Workbench
V670 The uninitialized class member 'm_OutBlobIdOrData' is used to initialize the 'm_StdOut' member. Remember that members are initialized in the order of their declarations inside a class. remote_app.hpp 215
class NCBI_XCONNECT_EXPORT CRemoteAppResult
{
public:
CRemoteAppResult(CNetCacheAPI::TInstance netcache_api,
size_t max_inline_size = kMaxBlobInlineSize) :
m_NetCacheAPI(netcache_api),
m_RetCode(-1),
m_StdOut(netcache_api, m_OutBlobIdOrData, m_OutBlobSize),
m_OutBlobSize(0),
m_StdErr(netcache_api, m_ErrBlobIdOrData, m_ErrBlobSize),
m_ErrBlobSize(0),
m_StorageType(eBlobStorage),
m_MaxInlineSize(max_inline_size)
{
}
....
};
LibreOffice
V670 The uninitialized class member 'm_aMutex' is used to initialize the 'm_aModifyListeners' member. Remember that members are initialized in the order of their declarations inside a class. fmgridif.cxx 1033
FmXGridPeer::FmXGridPeer(const Reference< XComponentContext >& _rxContext)
:m_aModifyListeners(m_aMutex)
,m_aUpdateListeners(m_aMutex)
,m_aContainerListeners(m_aMutex)
,m_aSelectionListeners(m_aMutex)
,m_aGridControlListeners(m_aMutex)
,m_aMode( getDataModeIdentifier() )
,m_nCursorListening(0)
,m_bInterceptingDispatch(false)
,m_xContext(_rxContext)
{
// Create must be called after this constructor
m_pGridListener.reset( new GridListenerDelegator( this ) );
}
class __declspec(dllexport) FmXGridPeer:
public cppu::ImplInheritanceHelper<....>
{
....
::comphelper::OInterfaceContainerHelper2 m_aModifyListeners,
m_aUpdateListeners,
m_aContainerListeners,
m_aSelectionListeners,
m_aGridControlListeners;
....
protected:
css::uno::Reference< css::uno::XComponentContext > m_xContext;
::osl::Mutex m_aMutex;
....
};
OInterfaceContainerHelper2( ::osl::Mutex & rMutex );
Haiku Operation System
V670 The uninitialized class member 'fPatternHandler' is used to initialize the 'fInternal' member. Remember that members are initialized in the order of their declarations inside a class. Painter.cpp 184
Painter::Painter()
:
fInternal(fPatternHandler),
....
fPatternHandler(),
....
{
....
};
class Painter {
....
private:
mutable PainterAggInterface fInternal; // line 336
bool fSubpixelPrecise : 1;
bool fValidClipping : 1;
bool fDrawingText : 1;
bool fAttached : 1;
bool fIdentityTransform : 1;
Transformable fTransform;
float fPenSize;
const BRegion* fClippingRegion;
drawing_mode fDrawingMode;
source_alpha fAlphaSrcMode;
alpha_function fAlphaFncMode;
cap_mode fLineCapMode;
join_mode fLineJoinMode;
float fMiterLimit;
PatternHandler fPatternHandler; // line 355
mutable AGGTextRenderer fTextRenderer;
};
Qt Creator
V670 [CWE-457, CERT-EXP53-CPP] The uninitialized class member 'm_undoStack' is used to initialize the 'm_document' member. Remember that members are initialized in the order of their declarations inside a class. compilerexplorereditor.cpp 774
class Editor : public Core::IEditor
{
public:
Editor(TextEditor::TextEditorActionHandler &actionHandler);
~Editor();
Core::IDocument *document() const override { return m_document.data(); }
QWidget *toolBar() override;
QSharedPointer<JsonSettingsDocument> m_document;
QUndoStack m_undoStack;
std::unique_ptr<QToolBar> m_toolBar;
};
Editor::Editor(TextEditorActionHandler &actionHandler)
: m_document(new JsonSettingsDocument(&m_undoStack))
{
setContext(Core::Context(Constants::CE_EDITOR_ID));
setWidget(new EditorWidget(m_document, &m_undoStack, actionHandler));
connect(&m_undoStack, &QUndoStack::canUndoChanged, this,
[&actionHandler] { actionHandler.updateActions(); });
connect(&m_undoStack, &QUndoStack::canRedoChanged, this,
[&actionHandler] { actionHandler.updateActions(); });
}