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

Warning generated when using QImage as QtConcurrent::mapped return type

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.0.0
    • 5.0.0 Beta 1, 5.0.0 Beta 2, 5.0.0 RC 1
    • Core: Threads
    • None
    • OS X 10.7.5, clang 3.1
    • e3b78896d21000c759ccc1e2781a471327307710

    Description

      QImage scaled(QImage & i) { return i; }
      
      void main()
      {
          QList<QImage> images;
          QList<QImage> future = QtConcurrent::blockingMapped(images, scaled);
      }
      

      Compiling the above code generates the following warning:

      In file included from /Qt/5.0/qtbase/include/QtCore/qvector.h:1:
      /Qt/5.0/qtbase/include/QtCore/../../src/corelib/tools/qvector.h:459:56: warning: source of this 'memcpy' call is a pointer to dynamic class 'QImage'; vtable pointer will be copied [-Wdynamic-class-memaccess]
                          ::memcpy(static_cast<void *>(dst), srcBegin, (srcEnd - srcBegin) * sizeof(T));
                          ~~~~~~~~                           ^
      

      QImage is treated as a POD type and memcpy is used to copy the data.

      Attachments

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

        Activity

          People

            liaqi Liang Qi
            stephenju Stephen Chu
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes