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
 VA Code Inspection problem.
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Breany
New Member

8 Posts

Posted - Mar 20 2018 :  03:34:23 AM  Show Profile  Reply with Quote
Given the following test code:

size_t* TestCode(int Len)
{
  size_t *result = (size_t*)malloc(sizeof(*result) + Len);
  return result;
}

Code inspections says that Variable can be declared auto, which is incorrect as sizeof(result) is used as a parameter.

feline
Whole Tomato Software

United Kingdom
18751 Posts

Posted - Mar 20 2018 :  08:36:19 AM  Show Profile  Reply with Quote
Which IDE and version of VA are you using? Code Inspection is not suggesting anything for me, placing this code into a .cpp file using VS2015 and VA 2258.

It is possible this has already been fixed in a recent build of VA, or I am not testing this in the right way.

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

Breany
New Member

8 Posts

Posted - Mar 20 2018 :  10:06:49 AM  Show Profile  Reply with Quote
My appologies for not including that before... It was late, I was tired.
VA_X.dll file version 10.9.2258.5 built 2018.03.06
DevEnv.exe version 14.0.25420.1 Professional
msenv.dll version 14.0.25425.1
Comctl32.dll version 6.10.7601.18837
Windows 7 6.1 Build 7601 Service Pack 1
8 processors (x86-64, WOW64)
Language info: 1252, 0x409
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18751 Posts

Posted - Mar 20 2018 :  2:22:50 PM  Show Profile  Reply with Quote
No problem, an easy thing to miss. But I am puzzled now, since I am using the same version of VA and the same IDE, but so far I am not seeing Code Inspection flag this.

What file extension is the code file where you are seeing this? Since it uses malloc I would guess pure C, but want to check.

If you have the time, can you please try making a new, default solution, and see if you get this problem when you paste this code into the new solution? I am trying to work out if this is somehow solution or file specific.

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