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
 #pragma push/pop blocks hide members
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Kram
Junior Member

Germany
16 Posts

Posted - Dec 06 2021 :  10:09:28 AM  Show Profile  Reply with Quote
Hello Support,

List of methods for the following example code does not show f2.


class t1
{
    void f1()
    {
    }

#pragma warning (push)
#pragma warning (disable : 26434)
    void f2()
#pragma warning (pop)
    {
    }

#pragma warning (push)
#pragma warning (disable : 26434)
    void f3()
    {
    }
#pragma warning (pop)

};




B00ting, please wait...

feline
Whole Tomato Software

United Kingdom
18749 Posts

Posted - Dec 14 2021 :  11:56:54 AM  Show Profile  Reply with Quote
I am seeing the same effect here. Thank you for the clear description.

case=11545

Are you seeing a lot of cases like this in your code, or just a few?

Basically VA's parser does not expect there to be anything between the signature line and the actual body of the function, and gets confused when there is.

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

Kram
Junior Member

Germany
16 Posts

Posted - Dec 14 2021 :  1:21:25 PM  Show Profile  Reply with Quote
30 or 40.

It's project containing a lot of legacy MFC code. The MFC class construction and default usage generates these warnings when compiled with newer toolchains. They are related to the function definition and inheritance / polymorphism.

The problem is that 26434 is a very generic. This is the reason why I placed it is round on the function definition part of the implementation. I do no want to blanket supress 26434 warnings in the rest of the code.

B00ting, please wait...
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18749 Posts

Posted - Dec 15 2021 :  09:11:24 AM  Show Profile  Reply with Quote
I have a work around for a macro version of this bug, where it is a macro between the function signature and the start of the body, but trying to use a macro to replace the

#pragma warning (pop)

line is refusing to compile for me. Apparently #pragma lines are considered before macros are expanded, which is stopping this otherwise nice idea from working.

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

Kram
Junior Member

Germany
16 Posts

Posted - Dec 16 2021 :  01:33:58 AM  Show Profile  Reply with Quote
As a workaround, placing the pragma at the top of the function body statement block works, see f4:
class t2
{
    void f1()
    {
    }

#pragma warning (push)
#pragma warning (disable : 26434)
    void f2()
#pragma warning (pop)
    {
    }

#pragma warning (push)
#pragma warning (disable : 26434)
    void f3()
    {
    }
#pragma warning (pop)

#pragma warning (push)
#pragma warning (disable : 26434)
    void f4()
    {
#pragma warning (pop)
    }

};

B00ting, please wait...
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18749 Posts

Posted - Dec 16 2021 :  07:29:39 AM  Show Profile  Reply with Quote
Ah, an interesting work around, than you for posting this It makes sense when you see it, but I am not sure I would have thought of that in a hurry. Hopefully this will help you in the cases you need to do this, until we get this bug in VA fixed.

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