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

MinGW 13.1.0: -Werror=dangling-reference in qopcuagenericstructhandlerprivate

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • None
    • dev
    • OpcUA
    • None
    • Windows
    • b43d011b63b2354c5d172ffef285e97b192b0f90

    Description

      MinGW 11.2.0 is being updated to 13.1.0 in Coin. There's a warning error from GCC 13 (+ MinGW) in Qtbase and while it's being fixed, I did a Coin run where I suppressed the werror in qtbase to see if there's any other errors in other builds.

      There's a warning error with MinGW 13.1.0 in qtopcua.

      Coin run:

      http://coin.ci.qt.io/coin/integration/qt/qt5/tasks/web_qt_qt5_1695892115920

      Build

      qt/qtopcua e59d127076343b9957949e1494b86dade7b50eb6 (0/1 completed)

      ID State Target Open
      windows-11_22h2-mingw11-developer-build  Error Windows Windows_11_22H2 (mingw-x86_64) log raw log downloads
      agent:2023/09/28 12:51:03 build.go:405: C:/Users/qt/work/qt/qtopcua/src/opcua/client/qopcuagenericstructhandlerprivate.cpp: In member function 'QOpcUaGenericStructValue QOpcUaGenericStructHandlerPrivate::decodeStructInternal(QOpcUaBinaryDataEncoding&, const QString&, bool&, int) const':
      agent:2023/09/28 12:51:03 build.go:405: C:/Users/qt/work/qt/qtopcua/src/opcua/client/qopcuagenericstructhandlerprivate.cpp:207:21: error: possibly dangling reference to a temporary [-Werror=dangling-reference]
      agent:2023/09/28 12:51:03 build.go:405:   207 |         const auto &field = entry->structureDefinition.fields().at(switchField - 1);
      agent:2023/09/28 12:51:03 build.go:405:       |                     ^~~~~
      agent:2023/09/28 12:51:03 build.go:405: C:/Users/qt/work/qt/qtopcua/src/opcua/client/qopcuagenericstructhandlerprivate.cpp:207:67: note: the temporary was destroyed at the end of the full expression 'QOpcUaStructureDefinition::fields() const().QList<QOpcUaStructureField>::at(((qsizetype)(switchField - 1)))'
      agent:2023/09/28 12:51:03 build.go:405:   207 |         const auto &field = entry->structureDefinition.fields().at(switchField - 1);
      agent:2023/09/28 12:51:03 build.go:405:       |                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
      agent:2023/09/28 12:51:03 build.go:405: cc1plus.exe: all warnings being treated as errors 

       

      Attachments

        Issue Links

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

          Activity

            People

              fmeerkoetter Frank Meerkötter
              eltoivol Elias Toivola
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes