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
 Suggests **, should suggest *
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

foxmuldr
Tomato Guru

USA
416 Posts

Posted - Sep 26 2014 :  08:28:15 AM  Show Profile  Reply with Quote
I came across this today. It is the first time I've seen it.



Since I'm assigning to *tFor, shouldn't it suggest SForClause* and not SForClause** ?? In testing, I observed the same behavior in VAX 2007.

I was able to reproduce it with this:
void test(void** vtest)
{
    *vtest = (v)
}

When you get to the "v" in "(v)", it gives you a suggestion of void**.

Best regards,
Rick C. Hodgin

-----
License: ... (1-user license) Support ends 2014.10.15
VA_X.dll file version 10.9.2048.0 built 2014.09.22
DevEnv.exe version 9.0.30729.1 Professional
msenv.dll version 9.0.30729.4462
Font: Ubuntu Mono 12 (pixels)
Comctl32.dll version 6.10.7601.17514
Windows 7 6.1 Build 7601 Service Pack 1
4 processors (x86-64, WOW64)
Language info: 1252, 0x409

Platform: Win32
Stable Includes:
c:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\include;
c:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\atlmfc\\include;
C:\\Program Files\\Microsoft SDKs\\Windows\\v6.0A\\include;
C:\\Program Files\\Microsoft SDKs\\Windows\\v6.0A\\include;

Other Includes:

Stable Source Directories:
c:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\atlmfc\\src\\mfc;
c:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\atlmfc\\src\\mfcm;
c:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\atlmfc\\src\\atl;
c:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\crt\\src;

Edited by - foxmuldr on Sep 26 2014 08:31:52 AM

feline
Whole Tomato Software

United Kingdom
19024 Posts

Posted - Sep 26 2014 :  9:50:46 PM  Show Profile  Reply with Quote
I am not sure why you are getting this suggestion here. I am seeing the same behaviour with your sample code, but at a guess the suggestion is going "not sure, but these two symbols are related". Given this, why remove a single star? What are you trying to do here? A manual cast?

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

foxmuldr
Tomato Guru

USA
416 Posts

Posted - Sep 27 2014 :  08:00:33 AM  Show Profile  Reply with Quote
quote:
Originally posted by feline

I am not sure why you are getting this suggestion here. I am seeing the same behaviour with your sample code, but at a guess the suggestion is going "not sure, but these two symbols are related". Given this, why remove a single star? What are you trying to do here? A manual cast?



Basically, something like this simplified example:
SForClause* iDbf_forClause_allocate(SForClause** tFor)
{
    // Make sure our environment is sane
    if (tFor)
    {
        // Allocate the new entry
        *tFor = (SForClause*)malloc(sizeof(SForClause));

        // Initialize it
        if (*tFor)
            memset(*tFor, 0, sizeof(SForClause));

        // Return our pointer to indicate if it succeeded
        return(*tFor);
    }
    return(NULL);
}
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19024 Posts

Posted - Sep 29 2014 :  11:09:55 PM  Show Profile  Reply with Quote
Ah, thank you for the code sample, now what you are thinking and doing makes sense. I am so used to thinking in terms of new and delete and the casting keywords I was not thinking in terms of malloc needing a cast. We are looking to make suggestions more sensible when we think you may be doing a cast, so I have added this to the case:

case=7519

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