Menu

Issues when building with MSVC and /permissive-

Xiang Fan
2017-05-05
2019-07-15
  • Xiang Fan

    Xiang Fan - 2017-05-05

    Hi,
    I’m a developer in Visual C++ compiler team. We are currently doing daily RWC (Read World Code) testing. Some of the libraries we test use WTL.
    We are also working with internal partners and the community to fix source issues exposed by /permissive-.
    The option isn’t finalized yet (we plan to add some large impact features into it in the incoming VS update), so we don’t suggest community to adopt it yet.
    In the meantime, we want to address these source issues as early as possible so that the community can adopt it when it is finalized.
    We discover some source issues when we build WTL with /permissive-.

    For example, in 'atldlgs.h', there are three places which call method from a dependent base and this is not allowed by C++ standard and MSVC enforces the requirement under /permissive-:

    One possible fix is to prefix these base methods with 'this->':

    Issue 1:
    LRESULT lRet = DefWindowProc(uMsg, wParam, lParam);
    ->
    LRESULT lRet = this->DefWindowProc(uMsg, wParam, lParam);

    Issue 2:
    ((m_psh.dwFlags & PSH_MODELESS) != 0) && (GetActivePage() == NULL))
    DestroyWindow();
    ->
    ((m_psh.dwFlags & PSH_MODELESS) != 0) && (this->GetActivePage() == NULL))
    this->DestroyWindow();

    What is the best way to get these issues fixed?

    Thanks!

     
  • Xiang Fan

    Xiang Fan - 2017-05-05

    There are lots of errors :-) You can see them by adding compiler flags '/permissive- /Zc:strictStrings-' to the projects in 'Sample' folder (Right click on the project, choose 'Properties', it is in 'Property Pages - Configuration Properties - C/C++ - Command Line - Additional Options'.

    Here is the blog post for '/permissive-'.

     
  • Nenad Stefanovic

    This will require a very large number of changes to the WTL code. Because of that, the changes will not be applied to the WTL 9.1 code, but to the next version of WTL.

    Thanks,
    Nenad

     
  • Xiang Fan

    Xiang Fan - 2017-05-10

    Hi,
    Thanks for the response. As long as it is on your radar, it is good :-).

     
  • foxpat

    foxpat - 2017-08-19

    what's the status on this?
    can I start a new project with VS 2017 and WTL or I rather look somewhere else?
    Thanks.

     
  • paul

    paul - 2017-12-06

    Great to see you working on /permissive- support. Any idea of a production date?

     
  • paul

    paul - 2018-09-20

    I see continued work on supporting /permissive-, thanks very much. Do you think the current trunk is useable for production software? If not, any update on when WTL10 will be released?

    Thanks,
    Paul

     
  • paul

    paul - 2019-07-15

    Hi Nenad,

    Just to share some good news. I updated our WTL to 10.9163 and made a few last tweaks to our code that uses WTL (make use of new macros that allow us to specify the enclosing class). A complex project we have now compiles with /permissive- using VS2019 16.1.4. Thanks very much for your work!

    Regards,
    Paul

     
  • Nenad Stefanovic

    Great news!

    Thanks,
    Nenad

     

Log in to post a comment.