Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 False unitialised Variable warnings in latest VA

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
Harald Krause Posted - Nov 20 2025 : 07:56:44 AM
All of those genereate "unitialised Variable" warnings in latest VA

int var = FunctionWithIntReturn();
int var = otherIntVariable;

Only this does not give a warning:

int var = 10;

Rebuilding the database did not help
2   L A T E S T    R E P L I E S    (Newest First)
Harald Krause Posted - Nov 20 2025 : 12:22:00 PM
Now I have strange behavior, your code pasted direct above of below such a wrong message and your code works correctly. But the false warning still is there.
Yes code does compile without warnings etc.
feline Posted - Nov 20 2025 : 09:34:22 AM
Here is my test case, based on your description:

static int FunctionWithIntReturn() { return 2; }
static void TestingCodeInspectInitialize()
{
	int varFromFunction = FunctionWithIntReturn();
	int varFromVariable = varFromFunction;
	int varDirect = 10;
	int varUninitialized;
}


only one variable is being picked up as not initialized.

My experiments with Code Inspection so far show that sometimes surrounding context matters. Also, does the code currently compile? If it doesn't that will also have an effect on things.

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000