Examples of errors detected by the V573 diagnostic
V573. Use of uninitialized variable 'Foo'. The variable was used to initialize itself.
Multi Theft Auto
V573 Uninitialized variable 'base' was used. The variable was used to initialize itself. ceguiwindow.cpp 1858
Vector2 Window::windowToScreen(const UVector2& vec) const
{
Vector2 base = d_parent ?
d_parent->windowToScreen(base) + getAbsolutePosition() :
getAbsolutePosition();
....
}
Similar errors can be found in some other places:
- V573 Uninitialized variable 'base' was used. The variable was used to initialize itself. ceguiwindow.cpp 1892
Firebird
V573 Uninitialized variable 'p' was used. The variable was used to initialize itself. restore.cpp 17535
void realign(....)
{
for (....)
{
UCHAR* p = buffer + field->fld_offset;
....
for (const burp_fld* field = relation->rel_fields;
field; field = field->fld_next)
{
....
UCHAR* p = buffer + FB_ALIGN(p - buffer, sizeof(SSHORT));
....
}
Similar errors can be found in some other places:
- V573 Uninitialized variable 'q' was used. The variable was used to initialize itself. restore.cpp 17536
Word for Windows 1.1a
V573 Uninitialized variable 'sectLast' was used. The variable was used to initialize itself. print2.c 599
FPrintSummaryInfo(doc, cpFirst, cpLim)
int doc;
CP cpFirst, cpLim;
{
int fRet = fFalse;
int pgnFirst = vpgnFirst;
int pgnLast = vpgnLast;
int sectFirst = vsectFirst;
int sectLast = sectLast;
....
}
This is what should have been written here: int sectLast = vsectLast;
Similar errors can be found in some other places:
- V573 Uninitialized variable 'sectLast' was used. The variable was used to initialize itself. print2.c 719
LLVM/Clang
V573 Uninitialized variable 'BytesToDrop' was used. The variable was used to initialize itself. typerecordmapping.cpp 73
static Error mapNameAndUniqueName(....) {
....
size_t BytesLeft = IO.maxFieldLength();
if (HasUniqueName) {
....
if (BytesNeeded > BytesLeft) {
size_t BytesToDrop = (BytesNeeded - BytesLeft);
size_t DropN = std::min(N.size(), BytesToDrop / 2);
size_t DropU = std::min(U.size(), BytesToDrop - DropN);
....
}
} else {
size_t BytesNeeded = Name.size() + 1;
StringRef N = Name;
if (BytesNeeded > BytesLeft) {
size_t BytesToDrop = std::min(N.size(), BytesToDrop); // <=
N = N.drop_back(BytesToDrop);
}
error(IO.mapStringZ(N));
}
....
}
Blend2D
V573 Uninitialized variable 'n' was used. The variable was used to initialize itself. pixelconverter.cpp 2210
static BLResult BL_CDECL bl_convert_multi_step(...., uint32_t w, ....)
{
for (uint32_t y = h; y; y--) {
uint32_t i = w;
workOpt.origin.x = baseOriginX;
dstData = dstLine;
srcData = srcLine;
while (i) {
uint32_t n = blMin(n, intermediatePixelCount);
srcToIntermediate(&ctx->first, intermediateData, 0,
srcData, srcStride, n, 1, nullptr);
intermediateToDst(&ctx->second, dstData, dstStride,
intermediateData, 0, n, 1, &workOpt);
dstData += n * dstBytesPerPixel;
srcData += n * srcBytesPerPixel;
workOpt.origin.x += int(n);
i -= n;
}
}
Microsoft PowerToys
V573 Uninitialized variable 'dpi' was used. The variable was used to initialize itself. Toolbar.cpp 112
LRESULT Toolbar::WindowProcessMessages(...., UINT msg, ....)
{
switch (msg)
{
....
case WM_DPICHANGED:
{
UINT dpi = LOWORD(dpi);
....
}
....
}
}