Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 False unitialised Variable warnings in latest VA
 New Topic  Reply to Topic
 Printer Friendly
Author  Topic Next Topic  

Harald Krause
Junior Member

Austria
21 Posts

Posted - Nov 20 2025 :  07:56:44 AM  Show Profile  Reply with Quote
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

feline
Whole Tomato Software

United Kingdom
19264 Posts

Posted - Nov 20 2025 :  09:34:22 AM  Show Profile  Reply with Quote
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.

zen is the art of being at one with the two'ness
Go to Top of Page

Harald Krause
Junior Member

Austria
21 Posts

Posted - Nov 20 2025 :  12:22:00 PM  Show Profile  Reply with Quote
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.
Go to Top of Page
   Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000