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

Compilerwarning [-warray-bounds] - GNU 14.2.1

    XMLWordPrintable

Details

    • Linux/X11

    Description

      When I compile Qt, I get some warnings:

      [1241/6442] Building CXX object qtbase/src/gui/CMakeFiles/Gui.dir/kernel/qguiapplication.cpp.o
      In file included from /home/Qt/toolchain/b/src/qt-build/qtbase/include/QtCore/qstring.h:1,
                       from /home/Qt/toolchain/b/src/qt/qtbase/src/corelib/kernel/qcoreapplication.h:8,
                       from /home/Qt/toolchain/b/src/qt-build/qtbase/include/QtCore/qcoreapplication.h:1,
                       from /home/Qt/toolchain/b/src/qt/qtbase/src/corelib/global/qt_pch.h:30,
                       from /home/Qt/toolchain/b/src/qt/qtbase/src/gui/kernel/qt_gui_pch.h:12,
                       from /home/Qt/toolchain/b/src/qt-build/qtbase/src/gui/CMakeFiles/Gui.dir/cmake_pch.hxx:5,
                       from <command-line>:
      In copy constructor ‘QString::QString(const QString&)’,
          inlined from ‘void QtPrivate::QMovableArrayOps<T>::emplace(qsizetype, Args&& ...) [with Args = {const QString&}; T = QString]’ at /home/Qt/toolchain/b/src/qt/qtbase/src/corelib/tools/qarraydataops.h:760:17,
          inlined from ‘T& QList<T>::emplaceBack(Args&& ...) [with Args = {const QString&}; T = QString]’ at /home/Qt/toolchain/b/src/qt/qtbase/src/corelib/tools/qlist.h:915:15,
          inlined from ‘void QList<T>::append(parameter_type) [with T = QString]’ at /home/Qt/toolchain/b/src/qt/qtbase/src/corelib/tools/qlist.h:489:48,
          inlined from ‘void init_platform(const QString&, const QString&, const QString&, int&, char**)’ at /home/Qt/toolchain/b/src/qt/qtbase/src/gui/kernel/qguiapplication.cpp:1356:26,
          inlined from ‘void QGuiApplicationPrivate::createPlatformIntegration()’ at /home/Qt/toolchain/b/src/qt/qtbase/src/gui/kernel/qguiapplication.cpp:1598:18:
      /home/Qt/toolchain/b/src/qt/qtbase/src/corelib/text/qstring.h:1339:40: warning: array subscript -1 is outside array bounds of ‘QString [384307168202282325]’ [-Warray-bounds=]
       1339 | QString::QString(const QString &other) noexcept : d(other.d)
            |                                        ^~~~~~~~
      [1771/6442] Automatic MOC for target Bluetooth
      AutoMoc: /home/Qt/toolchain/b/src/qt/qtconnectivity/src/bluetooth/qbluetoothlocaldevice_p.h: note: No relevant classes found. No output generated.
      AutoMoc: /home/Qt/toolchain/b/src/qt/qtconnectivity/src/bluetooth/qbluetoothdevicediscoveryagent_p.h: note: No relevant classes found. No output generated.
      AutoMoc: /home/Qt/toolchain/b/src/qt/qtconnectivity/src/bluetooth/qbluetoothservicediscoveryagent_p.h: note: No relevant classes found. No output generated.
      [1777/6442] Automatic MOC for target QmlDomPrivate
      AutoMoc: /home/Qt/toolchain/b/src/qt/qtdeclarative/src/qmldom/qqmldomfilelocations_p.h: note: No relevant classes found. No output generated.
      [2414/6442] Automatic MOC for target Quick
      AutoMoc: /home/Qt/toolchain/b/src/qt/qtdeclarative/src/quick/util/qquickprofiler_p.h: note: No relevant classes found. No output generated.
      [2556/6442] Building CXX object qtdeclarative/src/quick/CMakeFiles/Quick.dir/items/qsginternaltextnode.cpp.o
      In file included from /home/Qt/toolchain/b/src/qt-build/qtbase/include/QtCore/qarraydataops.h:1,
                       from /home/Qt/toolchain/b/src/qt/qtbase/src/corelib/tools/qarraydatapointer.h:7,
                       from /home/Qt/toolchain/b/src/qt-build/qtbase/include/QtCore/qarraydatapointer.h:1,
                       from /home/Qt/toolchain/b/src/qt/qtbase/src/corelib/text/qbytearray.h:11,
                       from /home/Qt/toolchain/b/src/qt-build/qtbase/include/QtCore/qbytearray.h:1,
                       from /home/Qt/toolchain/b/src/qt/qtbase/src/corelib/text/qstringview.h:10,
                       from /home/Qt/toolchain/b/src/qt-build/qtbase/include/QtCore/qstringview.h:1,
                       from /home/Qt/toolchain/b/src/qt/qtbase/src/corelib/text/qchar.h:728,
                       from /home/Qt/toolchain/b/src/qt-build/qtbase/include/QtCore/qchar.h:1,
                       from /home/Qt/toolchain/b/src/qt/qtbase/src/corelib/text/qstring.h:14,
                       from /home/Qt/toolchain/b/src/qt-build/qtbase/include/QtCore/qstring.h:1,
                       from /home/Qt/toolchain/b/src/qt/qtbase/src/corelib/kernel/qobject.h:11,
                       from /home/Qt/toolchain/b/src/qt-build/qtbase/include/QtCore/qobject.h:1,
                       from /home/Qt/toolchain/b/src/qt/qtbase/src/corelib/animation/qabstractanimation.h:7,
                       from /home/Qt/toolchain/b/src/qt-build/qtbase/include/QtCore/qabstractanimation.h:1,
                       from /home/Qt/toolchain/b/src/qt-build/qtbase/include/QtCore/QtCore:19,
                       from /home/Qt/toolchain/b/src/qt-build/qtdeclarative/src/quick/CMakeFiles/Quick.dir/cmake_pch.hxx:5,
                       from <command-line>:
      In member function ‘void QtPrivate::QPodArrayOps<T>::emplace(qsizetype, Args&& ...) [with Args = {QTextFrame*&}; T = QTextFrame*]’,
          inlined from ‘T& QList<T>::emplaceBack(Args&& ...) [with Args = {QTextFrame*&}; T = QTextFrame*]’ at /home/Qt/toolchain/b/src/qt/qtbase/src/corelib/tools/qlist.h:915:15,
          inlined from ‘void QList<T>::append(parameter_type) [with T = QTextFrame*]’ at /home/Qt/toolchain/b/src/qt/qtbase/src/corelib/tools/qlist.h:489:48,
          inlined from ‘virtual void QSGInternalTextNode::doAddTextDocument(QPointF, QTextDocument*, int, int)’ at /home/Qt/toolchain/b/src/qt/qtdeclarative/src/quick/items/qsginternaltextnode.cpp:163:18:
      /home/Qt/toolchain/b/src/qt/qtbase/src/corelib/tools/qarraydataops.h:152:17: warning: array subscript -1 is outside array bounds of ‘QTextFrame* [1152921504606846975]’ [-Warray-bounds=]
        152 |                 new (this->begin() - 1) T(std::forward<Args>(args)...);
            |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      [2574/6442] Building CXX object qtdeclarative/src/quick/CMakeFiles/Quick.dir/items/qquicktextedit.cpp.o
      In file included from /home/Qt/toolchain/b/src/qt-build/qtbase/include/QtCore/qarraydataops.h:1,
                       from /home/Qt/toolchain/b/src/qt/qtbase/src/corelib/tools/qarraydatapointer.h:7,
                       from /home/Qt/toolchain/b/src/qt-build/qtbase/include/QtCore/qarraydatapointer.h:1,
                       from /home/Qt/toolchain/b/src/qt/qtbase/src/corelib/text/qbytearray.h:11,
                       from /home/Qt/toolchain/b/src/qt-build/qtbase/include/QtCore/qbytearray.h:1,
                       from /home/Qt/toolchain/b/src/qt/qtbase/src/corelib/text/qstringview.h:10,
                       from /home/Qt/toolchain/b/src/qt-build/qtbase/include/QtCore/qstringview.h:1,
                       from /home/Qt/toolchain/b/src/qt/qtbase/src/corelib/text/qchar.h:728,
                       from /home/Qt/toolchain/b/src/qt-build/qtbase/include/QtCore/qchar.h:1,
                       from /home/Qt/toolchain/b/src/qt/qtbase/src/corelib/text/qstring.h:14,
                       from /home/Qt/toolchain/b/src/qt-build/qtbase/include/QtCore/qstring.h:1,
                       from /home/Qt/toolchain/b/src/qt/qtbase/src/corelib/kernel/qobject.h:11,
                       from /home/Qt/toolchain/b/src/qt-build/qtbase/include/QtCore/qobject.h:1,
                       from /home/Qt/toolchain/b/src/qt/qtbase/src/corelib/animation/qabstractanimation.h:7,
                       from /home/Qt/toolchain/b/src/qt-build/qtbase/include/QtCore/qabstractanimation.h:1,
                       from /home/Qt/toolchain/b/src/qt-build/qtbase/include/QtCore/QtCore:19,
                       from /home/Qt/toolchain/b/src/qt-build/qtdeclarative/src/quick/CMakeFiles/Quick.dir/cmake_pch.hxx:5,
                       from <command-line>:
      In member function ‘void QtPrivate::QPodArrayOps<T>::emplace(qsizetype, Args&& ...) [with Args = {QTextFrame*&}; T = QTextFrame*]’,
          inlined from ‘T& QList<T>::emplaceBack(Args&& ...) [with Args = {QTextFrame*&}; T = QTextFrame*]’ at /home/Qt/toolchain/b/src/qt/qtbase/src/corelib/tools/qlist.h:915:15,
          inlined from ‘void QList<T>::append(parameter_type) [with T = QTextFrame*]’ at /home/Qt/toolchain/b/src/qt/qtbase/src/corelib/tools/qlist.h:489:48,
          inlined from ‘virtual QSGNode* QQuickTextEdit::updatePaintNode(QSGNode*, QQuickItem::UpdatePaintNodeData*)’ at /home/Qt/toolchain/b/src/qt/qtdeclarative/src/quick/items/qquicktextedit.cpp:2555:22:
      /home/Qt/toolchain/b/src/qt/qtbase/src/corelib/tools/qarraydataops.h:152:17: warning: array subscript -1 is outside array bounds of ‘QTextFrame* [1152921504606846975]’ [-Warray-bounds=]
        152 |                 new (this->begin() - 1) T(std::forward<Args>(args)...);
            |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      

      Compiler:

      -- The CXX compiler identification is GNU 14.2.1
      -- The C compiler identification is GNU 14.2.1
      -- The ASM compiler identification is GNU
      -- Found assembler: /usr/bin/cc
      

      Configure:

      /home/Qt/toolchain/b/src/qt/qtbase/configure -top-level -release -optimize-size -force-debug-info -prefix /home/Qt/toolchain/dist -system-proxies -openssl-linked -I /home/Qt/toolchain/dist/include -L /home/Qt/toolchain/dist/lib -no-journald -no-directfb -no-linuxfb -no-libproxy --linker=gold -no-qml-debug -opensource -confirm-license -nomake examples -nomake tests -no-mtdev -no-dbus -qt-zlib -qt-pcre -qt-harfbuzz -qt-libpng -qt-libjpeg -skip qtactiveqt,qtlanguageserver -submodules qtbase,qtwebsockets,qtscxml,qttranslations,qtdeclarative,qtimageformats,qttools,qtsvg,qtconnectivity,qtshadertools -- -DBUILD_qtbase=ON -DBUILD_qtwebsockets=ON -DBUILD_qtscxml=ON -DBUILD_qttranslations=ON -DBUILD_qtdeclarative=ON -DBUILD_qtimageformats=ON -DBUILD_qttools=ON -DBUILD_qtsvg=ON -DBUILD_qtconnectivity=ON -DBUILD_qtshadertools=ON -DOPENSSL_ROOT_DIR=/home/Qt/toolchain/dist -DCMAKE_PREFIX_PATH=/home/Qt/toolchain/dist
      

      Attachments

        Issue Links

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

          Activity

            People

              thiago Thiago Macieira
              larss Lars Schmertmann
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes