Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-56880

permissive C++ code in windows specific files

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.8.0 RC
    • 5.8.0 Alpha
    • None
    • Windows build
    • f46977ae785632e52fc7212265f2e1e0d38565db

    Description

      The Microsoft C++ team uses the latest Qt build as part of our 'real world code' compiler tests. When testing language conformance improvements in the compiler I noticed a few places that will need to change if you use the new /permissive- switch. I am unable to do a pull request because I don't have a corporate contribution license, so instead I am writing a bug with a suggested fix.

      Issue 1) Losing const qualifier from string literal (also covered under /Zc:strictStrings)
      src\systeminfo\windows\qwmihelper_win.cpp
      Line 138:
      hres = wbemServices->ExecQuery((BSTR)L"WQL", bstrQuery, //add cast
      WBEM_FLAG_BIDIRECTIONAL | WBEM_FLAG_RETURN_IMMEDIATELY,0,&wbemEnumerator);

      Line 293
      hres = wbemServices->ExecNotificationQueryAsync(
      (BSTR)L"WQL", //add cast
      bstrQuery,
      WBEM_FLAG_SEND_STATUS,
      NULL,
      pStubSink);

      Issue 2) The MSVC compiler extension to treat copy initialization as direct initialization is disabled under /permissive-
      qnetworkinfo_win.cpp line 1082
      for (uint i = 0; i < ssid.uSSIDLength;i++) {
      QString temp ( ssid.ucSSID[i] ); // {} initialization also fixes it
      netname += temp;
      }

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            mkalinow Maurice Kalinowski
            phil.christensen Phil Christensen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes