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

can't build with gcc 8.2.1 due to errors about copying non-trivial types etc.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Done
    • Affects Version/s: 5.9.8
    • Fix Version/s: 5.9.8
    • Component/s: Core: Other
    • Labels:
      None
    • Environment:
      Arch Linux
    • Platform/s:
      Linux/X11
    • Commits:
      b110a8eda6876261f945d292e888ee8405ababdd

      Description

      It's been a few weeks since I tried to build on Arch; just upgraded everything and now there are these errors, which I assume must be due to a compiler upgrade:

      /home/rutledge/dev/qt59/qtbase/src/gui/painting/qoutlinemapper.cpp: In member function ‘QT_FT_Outline* QOutlineMapper::convertPath(const QVectorPath&)’:
      /home/rutledge/dev/qt59/qtbase/src/gui/painting/qoutlinemapper.cpp:182:76: error: ‘void* memcpy(void*, const void*, size_t)’ copying an object of non-trivial type ‘class QPointF’ from an array of ‘const qreal’ {aka ‘const double’} [-Werror=class-memaccess]
                   memcpy(m_elements.data(), path.points(), count* sizeof(QPointF));
                                                                                  ^
      In file included from ../../include/QtCore/qpoint.h:1,
                       from ../../include/QtCore/../../../../qt59/qtbase/src/corelib/tools/qrect.h:45,
                       from ../../include/QtCore/qrect.h:1,
                       from /home/rutledge/dev/qt59/qtbase/src/gui/painting/qoutlinemapper_p.h:55,
                       from /home/rutledge/dev/qt59/qtbase/src/gui/painting/qoutlinemapper.cpp:40:
      ../../include/QtCore/../../../../qt59/qtbase/src/corelib/tools/qpoint.h:219:21: note: ‘class QPointF’ declared here
       class Q_CORE_EXPORT QPointF
                           ^~~~~~~
      cc1plus: all warnings being treated as errors
      make[3]: *** [Makefile:64047: .obj/qoutlinemapper.o] Error 1
      make[3]: *** Waiting for unfinished jobs....
      /home/rutledge/dev/qt59/qtbase/src/gui/painting/qpainter.cpp: In member function ‘void QPainterPrivate::drawGlyphs(const quint32*, QFixedPoint*, int, QFontEngine*, bool, bool, bool)’:
      /home/rutledge/dev/qt59/qtbase/src/gui/painting/qpainter.cpp:5625:68: error: ‘void* memset(void*, int, size_t)’ clearing an object of non-trivial type ‘struct QFixed’; use assignment or value-initialization instead [-Werror=class-memaccess]
               memset(advances.data(), 0, advances.size() * sizeof(QFixed));
                                                                          ^
      In file included from ../../include/QtGui/5.9.8/QtGui/private/qfixed_p.h:1,
                       from ../../include/QtGui/5.9.8/QtGui/private/../../../../../../../qt59/qtbase/src/gui/text/qfont_p.h:61,
                       from ../../include/QtGui/5.9.8/QtGui/private/qfont_p.h:1,
                       from ../../include/QtGui/5.9.8/QtGui/private/../../../../../../../qt59/qtbase/src/gui/text/qtextengine_p.h:60,
                       from ../../include/QtGui/5.9.8/QtGui/private/qtextengine_p.h:1,
                       from ../../include/QtGui/5.9.8/QtGui/private/../../../../../../../qt59/qtbase/src/gui/text/qfontengine_p.h:59,
                       from ../../include/QtGui/5.9.8/QtGui/private/qfontengine_p.h:1,
                       from /home/rutledge/dev/qt59/qtbase/src/gui/painting/qpainter.cpp:65:
      ../../include/QtGui/5.9.8/QtGui/private/../../../../../../../qt59/qtbase/src/gui/painting/qfixed_p.h:61:8: note: ‘struct QFixed’ declared here
       struct QFixed {
              ^~~~~~
      /home/rutledge/dev/qt59/qtbase/src/gui/painting/qpainter.cpp:5626:103: error: ‘void* memset(void*, int, size_t)’ clearing an object of non-trivial type ‘struct QGlyphJustification’; use assignment or value-initialization instead [-Werror=class-memaccess]
               memset(glyphJustifications.data(), 0, glyphJustifications.size() * sizeof(QGlyphJustification));
                                                                                                             ^
      In file included from ../../include/QtGui/5.9.8/QtGui/private/qtextengine_p.h:1,
                       from ../../include/QtGui/5.9.8/QtGui/private/../../../../../../../qt59/qtbase/src/gui/text/qfontengine_p.h:59,
                       from ../../include/QtGui/5.9.8/QtGui/private/qfontengine_p.h:1,
                       from /home/rutledge/dev/qt59/qtbase/src/gui/painting/qpainter.cpp:65:
      ../../include/QtGui/5.9.8/QtGui/private/../../../../../../../qt59/qtbase/src/gui/text/qtextengine_p.h:158:8: note: ‘struct QGlyphJustification’ declared here
       struct QGlyphJustification
              ^~~~~~~~~~~~~~~~~~~
      cc1plus: all warnings being treated as errors
      make[3]: *** [Makefile:66168: .obj/qpainter.o] Error 1
      In file included from ../../include/QtCore/qvariantanimation.h:1,
                       from /home/rutledge/dev/qt59/qtbase/src/gui/animation/qguivariantanimation.cpp:43:
      ../../include/QtCore/../../../../qt59/qtbase/src/corelib/animation/qvariantanimation.h: In instantiation of ‘void qRegisterAnimationInterpolator(QVariant (*)(const T&, const T&, qreal)) [with T = QColor; qreal = double]’:
      /home/rutledge/dev/qt59/qtbase/src/gui/animation/qguivariantanimation.cpp:68:73:   required from here
      ../../include/QtCore/../../../../qt59/qtbase/src/corelib/animation/qvariantanimation.h:116:45: error: cast between incompatible function types from ‘QVariant (*)(const QColor&, const QColor&, qreal)’ {aka ‘QVariant (*)(const QColor&, const QColor&, double)’} to ‘QVariantAnimation::Interpolator’ {aka ‘QVariant (*)(const void*, const void*, double)’} [-Werror=cast-function-type]
           QVariantAnimation::registerInterpolator(reinterpret_cast<QVariantAnimation::Interpolator>(func), qMetaTypeId<T>());
                                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      ../../include/QtCore/../../../../qt59/qtbase/src/corelib/animation/qvariantanimation.h: In instantiation of ‘void qRegisterAnimationInterpolator(QVariant (*)(const T&, const T&, qreal)) [with T = QVector2D; qreal = double]’:
      /home/rutledge/dev/qt59/qtbase/src/gui/animation/qguivariantanimation.cpp:69:79:   required from here
      ../../include/QtCore/../../../../qt59/qtbase/src/corelib/animation/qvariantanimation.h:116:45: error: cast between incompatible function types from ‘QVariant (*)(const QVector2D&, const QVector2D&, qreal)’ {aka ‘QVariant (*)(const QVector2D&, const QVector2D&, double)’} to ‘QVariantAnimation::Interpolator’ {aka ‘QVariant (*)(const void*, const void*, double)’} [-Werror=cast-function-type]
      ../../include/QtCore/../../../../qt59/qtbase/src/corelib/animation/qvariantanimation.h: In instantiation of ‘void qRegisterAnimationInterpolator(QVariant (*)(const T&, const T&, qreal)) [with T = QVector3D; qreal = double]’:
      /home/rutledge/dev/qt59/qtbase/src/gui/animation/qguivariantanimation.cpp:70:79:   required from here
      ../../include/QtCore/../../../../qt59/qtbase/src/corelib/animation/qvariantanimation.h:116:45: error: cast between incompatible function types from ‘QVariant (*)(const QVector3D&, const QVector3D&, qreal)’ {aka ‘QVariant (*)(const QVector3D&, const QVector3D&, double)’} to ‘QVariantAnimation::Interpolator’ {aka ‘QVariant (*)(const void*, const void*, double)’} [-Werror=cast-function-type]
      ../../include/QtCore/../../../../qt59/qtbase/src/corelib/animation/qvariantanimation.h: In instantiation of ‘void qRegisterAnimationInterpolator(QVariant (*)(const T&, const T&, qreal)) [with T = QVector4D; qreal = double]’:
      /home/rutledge/dev/qt59/qtbase/src/gui/animation/qguivariantanimation.cpp:71:79:   required from here
      ../../include/QtCore/../../../../qt59/qtbase/src/corelib/animation/qvariantanimation.h:116:45: error: cast between incompatible function types from ‘QVariant (*)(const QVector4D&, const QVector4D&, qreal)’ {aka ‘QVariant (*)(const QVector4D&, const QVector4D&, double)’} to ‘QVariantAnimation::Interpolator’ {aka ‘QVariant (*)(const void*, const void*, double)’} [-Werror=cast-function-type]
      ../../include/QtCore/../../../../qt59/qtbase/src/corelib/animation/qvariantanimation.h: In instantiation of ‘void qRegisterAnimationInterpolator(QVariant (*)(const T&, const T&, qreal)) [with T = QQuaternion; qreal = double]’:
      /home/rutledge/dev/qt59/qtbase/src/gui/animation/qguivariantanimation.cpp:72:83:   required from here
      ../../include/QtCore/../../../../qt59/qtbase/src/corelib/animation/qvariantanimation.h:116:45: error: cast between incompatible function types from ‘QVariant (*)(const QQuaternion&, const QQuaternion&, qreal)’ {aka ‘QVariant (*)(const QQuaternion&, const QQuaternion&, double)’} to ‘QVariantAnimation::Interpolator’ {aka ‘QVariant (*)(const void*, const void*, double)’} [-Werror=cast-function-type]
      

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              thiago Thiago Macieira
              Reporter:
              srutledg Shawn Rutledge
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes