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

Mismatched-new-delete warning when using qmltypes with mingw 9.0

    XMLWordPrintable

Details

    • Windows
    • c3c9c84379 (qt/qtdeclarative/dev) c3c9c84379 (qt/tqtc-qtdeclarative/dev) 7fc2f9bbc4 (qt/qtdeclarative/6.4) 7fc2f9bbc4 (qt/tqtc-qtdeclarative/6.4)

    Description

      When building a simple application that uses CONFIG+=qmltypes, building qmltyperegistrations causes a warning:

      In file included from C:/Qt/6.2.2/mingw_64/include/QtQml/qqml.h:43,
                       from qtbug_qmltyperegistrations.cpp:7:
      C:/Qt/6.2.2/mingw_64/include/QtQml/qqmlprivate.h: In function 'void QQmlPrivate::createInto(void*, void*) [with T = test]':
      C:/Qt/6.2.2/mingw_64/include/QtQml/qqmlprivate.h:188:45: warning: 'static void QQmlPrivate::QQmlElement<T>::operator delete(void*, void*) [with T = test]' called on pointer returned from a mismatched allocation function [-Wmismatched-new-delete]
        188 |     void createInto(void *memory, void *) { new (memory) QQmlElement<T>; }
            |                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      C:/Qt/6.2.2/mingw_64/include/QtQml/qqmlprivate.h:188:45: note: returned from 'void* operator new(std::size_t, void*)'
      

      This is caused by the mingw version bump from 8.1 to 9.0 in Qt 6.2.1->6.2.2 update (as the -Wmismatched-new-delete is now on by default).

      Attachments

        Issue Links

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

          Activity

            People

              ulherman Ulf Hermann
              jussi_witick Jussi Witick
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes