Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
6.9
-
None
-
Fedora 42
Description
Consider the following code
import QtQuick MouseArea { property int wheelDelta: 0 onWheel: wheel => { const delta = (wheel.angleDelta.y || -wheel.angleDelta.x) * (wheel.inverted ? -1 : 1) wheelDelta += delta; } }
When building with qmlcachgen the generated code results in a C++ compiler warning
In file included from /home/nico/kde/usr/include/QtCore/qbytearray.h:11, from /home/nico/kde/usr/include/QtCore/qstringview.h:10, from /home/nico/kde/usr/include/QtCore/qchar.h:728, from /home/nico/kde/usr/include/QtCore/qstring.h:14, from /home/nico/kde/usr/include/QtQml/qjsprimitivevalue.h:10, from /home/nico/kde/usr/include/QtQml/qqmlprivate.h:18, from /home/nico/kde/build/qqc2-desktop-style/.rcc/qmlcache/org_kde_desktop_org.kde.desktop/Slider_qml.cpp:2: In copy constructor 'QArrayDataPointer<T>::QArrayDataPointer(const QArrayDataPointer<T>&) [with T = char16_t]', inlined from 'QString::QString(const QString&)' at /home/nico/kde/usr/include/QtCore/qstring.h:1339:51, inlined from 'constexpr QJSPrimitiveValue::QJSPrimitiveValuePrivate& QJSPrimitiveValue::QJSPrimitiveValuePrivate::operator=(const QJSPrimitiveValue::QJSPrimitiveVal uePrivate&)' at /home/nico/kde/usr/include/QtQml/qjsprimitivevalue.h:777:55, inlined from 'constexpr QJSPrimitiveValue& QJSPrimitiveValue::operator=(const QJSPrimitiveValue&)' at /home/nico/kde/usr/include/QtQml/qjsprimitivevalue.h:24:7, inlined from 'QmlCacheGeneratedCode::_qt_qml_org_kde_desktop_Slider_qml::<lambda(const QQmlPrivate::AOTCompiledContext*, void**)>' at /home/nico/kde/build/qqc2-desk top-style/.rcc/qmlcache/org_kde_desktop_org.kde.desktop/Slider_qml.cpp:313:8: /home/nico/kde/usr/include/QtCore/qarraydatapointer.h:38:50: warning: '*(const QArrayDataPointer<char16_t>*)((char*)&r2_6 + offsetof(QJSPrimitiveValue, QJSPrimitiveValu e::d.QJSPrimitiveValue::QJSPrimitiveValuePrivate::<unnamed>)).QArrayDataPointer<char16_t>::size' may be used uninitialized [-Wmaybe-uninitialized] 38 | : d(other.d), ptr(other.ptr), size(other.size) | ~~~~~~^~~~ /home/nico/kde/build/qqc2-desktop-style/.rcc/qmlcache/org_kde_desktop_org.kde.desktop/Slider_qml.cpp: In lambda function: /home/nico/kde/build/qqc2-desktop-style/.rcc/qmlcache/org_kde_desktop_org.kde.desktop/Slider_qml.cpp:204:19: note: 'r2_6' declared here 204 | QJSPrimitiveValue r2_6; | ^~~~