Details
-
Bug
-
Resolution: Duplicate
-
Not Evaluated
-
None
-
6.5.3, 6.6.3
-
None
Description
Given this C++ and QML code:
signals:
void captureAndScanFinished(const QVariantList &items);
onCaptureAndScanFinished: function(items) {
console.log("scanned", items.length)
}
The compiler generates this code, which clang on macOS, iOS and Android rightfully complains about:
... QVariantList r6_0 = (*static_cast<QVariantList*>(argumentsPtr[0])); QString r11_0; QVariantList r2_1; QString r2_0; QString r12_0; // generate_LoadRuntimeString r2_0 = QStringLiteral("scanned"); // generate_StoreReg r11_0 = std::move(r2_0); // generate_LoadReg r2_1 = std::move(r6_0); // generate_GetLookup { int retrieved; retrieved = r2_1.length(); //!!!!!!!!!!!!!! HERE, LINE 1697 r2_0 = QJSPrimitiveValue(retrieved).toString(); } ...
with
.../.rcc/qmlcache/mobile_module_ItemScannerDialog_qml.cpp:1697:18: error: implicit conversion loses integer precision: 'qsizetype' (aka 'long long') to 'int' [-Werror,-Wshorten-64-to-32] retrieved = r2_1.length(); ~ ~~~~~^~~~~~~~
Attachments
Issue Links
- duplicates
-
QTBUG-122582 qmlcachegen generates code with int/qsizetype confusion
-
- Closed
-