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 Previous Topic 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
19282 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

feline
Whole Tomato Software

United Kingdom
19282 Posts

Posted - Nov 21 2025 :  06:46:38 AM  Show Profile  Reply with Quote
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.

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

barto
Junior Member

Germany
20 Posts

Posted - Nov 21 2025 :  08:10:42 AM  Show Profile  Reply with Quote
I also noticed this in various places







Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19282 Posts

Posted - Nov 21 2025 :  08:28:33 AM  Show Profile  Reply with Quote
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.

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

jschroedl
Tomato Guru

USA
112 Posts

Posted - Dec 01 2025 :  4:28:04 PM  Show Profile  Reply with Quote
I am also seeing lots of incorrect "variable 'xyz' is not initialized" warnings from VA Code Inspection.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19282 Posts

Posted - Dec 08 2025 :  07:53:21 AM  Show Profile  Reply with Quote
When you get them, what is the symbol on the right hand side? Does it tend to be a function call? A expression that needs to be evaluated? Something else?

People are seeing this problem, but so far I haven't managed to reproduce anything here. Once I can reproduce it, I can start trying to work out the trigger, and what we might be able to do about it.

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

feline
Whole Tomato Software

United Kingdom
19282 Posts

Posted - Dec 15 2025 :  1:09:17 PM  Show Profile  Reply with Quote
Anyone who is getting this problem, can you please look at your Visual Studio project properties, and check to see if you are using the field:

Project properties -> VC++ Directories -> External Include Directories = "..."

if the problem is showing up with a symbol / function that is defined in a library included via the EXTERNAL include directories, are you able to update your project settings to place this include directory into the:

Project properties -> VC++ Directories -> Include Directories = "..."

field instead? I have finally been able to reproduce this problem here, and this was the trigger for me. I have put in a bug report for this:

case=166067

There may be other triggers, but we now know to check include directory settings.

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic 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