Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 VA Code Inspection problem.

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
Breany Posted - Mar 20 2018 : 03:34:23 AM
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.
3   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Mar 20 2018 : 2:22:50 PM
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.
Breany Posted - Mar 20 2018 : 10:06:49 AM
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
feline Posted - Mar 20 2018 : 08:36:19 AM
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.

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