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

Potentially uninitialized local variable 'meType' used in QTestMouse.h

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 6.4.3
    • Testing: qtestlib
    • None
    • Windows

    Description

      Configurations:

      • Qt Version: 6.4.3
      • Compiler: Microsoft Visual C++ Compiler 16.11.33423.256 (amd64)
      • CMake Version: 3.24.2 (Qt)
      • QtCreator version: 10.0.0
      • C++ Compiler version = 16
      • Added definitions: -Wall -fvisibility=hidden
      • CMAKE_CXX_STANDARD=11
      • COMPILER_FLAGS
                        "/W4"
                        "/WX"       # treat all warnings as errors
                        "/wdxxxx"   # suppress specific warnings
                        "/wd4820"   # suppress warning about padding
                        "/wd4625"   # suppress warning:
                                    # copy constructor could not be generated because a base class
                                    # copy constructor is inaccessible or deleted
                        "/wd4626"   # assignment operator could not be generated because a base
                                    # class assignment operator is inaccessible or deleted
                        "/wd4127"   # suppress warning: conditional expression is constant
                        "/wd4505"   # suppress warning: unreferenced function has been removed
                        "/wd4206"   # suppress warning: translation unit is empty
                        "/wd4515"   # suppress warning: namespace uses itself
                         "/wd4512"   # suppress warning: assignment operator could not be generated
                                    # A fix is planned in Qt 5.4.2 (https://bugreports.qt.io/browse/QTBUG-7233)
                                    # Check later with Qt >= 5.4.2 if warning suppression can be removed
                        "/wd4702"   # Ignore unreachable code (workaround qtestcase) Qt > 6.4.3
                        "/wd4714"   # suppress warning: marked __forceinline but are not inlined
                                    # Fixed in Qt 5.10.0 (https://bugreports.qt.io/browse/QTBUG-55042)
                                    # Check later with Qt >= 5.10.0 if warning suppression can be removed
                        "/wd4718"   # Workaround for https://bugreports.qt.io/browse/QTBUG-54089
                        "/nologo"
                        "/EHsc-"    # disable exceptions
                        "/GR-"      # disable RTTI
                        "/DyNAMICBASE"
                        "/GS"
                        "/sdl"
                        "/Wv:18"    # disable warnings introduced in this compiler version

      Issue:
      It seems that with my configuration I get the following warning (but treated as an Error):

      You can clearly see this in the source code of 6.4.3 (see: https://codebrowser.dev/qt6/qtbase/src/testlib/qtestmouse.h.html , line: 200) that There is a potentially uninitialized local variable 'meType', as it's not assigned on the default clause in a switch case (which causes the warning in my case).

      I'll add temporarily an extra ignore warning flag in this case as a workaround, but I suppose this shouldn't be done explicitly.

      Attachments

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

        Activity

          People

            macadder Jason McDonald
            kevanvanderstichelen Kevan Vanderstichelen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes