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
6   L A T E S T    R E P L I E S    (Newest First)
jschroedl Posted - Dec 01 2025 : 4:28:04 PM
I am also seeing lots of incorrect "variable 'xyz' is not initialized" warnings from VA Code Inspection.
feline Posted - Nov 21 2025 : 08:28:33 AM
Are any of the symbols on the right hand side of = local symbols? Or are they all from some other scope? Clearly this happens, but until I can get an example to trigger here on demand, I am left guessing at what is happening.
barto Posted - Nov 21 2025 : 08:10:42 AM
I also noticed this in various places







feline Posted - Nov 21 2025 : 06:46:38 AM
If you were able to share code snippets privately, I am happy to look at them with you. A wild guess, if Code Inspection isn't finding the correct header files for some reason, then it would not find the function signature, so could perhaps result in this warning. I would hope it would do something else, but its a guess that would sort of fit the facts.

Anything you send to [email protected] will be treated as private information, and only used to try and understand the problem. But I understand code often cannot be shared at all.
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