Qt 5.13 warnings when build for iOS. How to fix it?
-
Make the conversion explicit using a suitable cast.
Next time: post the whole warning message and the code which the warning concerns
-
@bogong are you building for simulator? because iOS devices should be 64 bit, which should make the int 64 bit which should make the implicit cast moot
@j-hilk It's for Qt Test on 5.12.4: It's happening when I am building static library for iOS with tests for iPhone 6SE, for simulator works fine. For Qt 5.13 couldn't say anything because Qt 5.13 killed on my computer after weekend of fighting against it :-) Awaiting Qt 5.13.1 within big hope :-)
-
The same issue on Qt 5.13.1 when building for iOS and for Simulator too.
In file included from /Users/alexandr/Projects/arboreus/arboreus_examples/qt/build-HandlingQMLFromCPP-Qt_5_13_1_for_iOS_Simulator-Debug/handlingqmlfromcpp_qml_plugin_import.cpp:3: In file included from /Users/alexandr/Tools/qt/5.13.1/ios/include/QtCore/QtPlugin:1: In file included from /Users/alexandr/Tools/qt/5.13.1/ios/include/QtCore/qplugin.h:44: In file included from /Users/alexandr/Tools/qt/5.13.1/ios/include/QtCore/qobject.h:49: /Users/alexandr/Tools/qt/5.13.1/ios/include/QtCore/qlist.h:1034:26: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32] return n - b; ~~~~~~ ~~^~~ In file included from /Users/alexandr/Projects/arboreus/arboreus_examples/qt/build-HandlingQMLFromCPP-Qt_5_13_1_for_iOS_Simulator-Debug/handlingqmlfromcpp_qml_plugin_import.cpp:3: In file included from /Users/alexandr/Tools/qt/5.13.1/ios/include/QtCore/QtPlugin:1: In file included from /Users/alexandr/Tools/qt/5.13.1/ios/include/QtCore/qplugin.h:44: In file included from /Users/alexandr/Tools/qt/5.13.1/ios/include/QtCore/qobject.h:49: In file included from /Users/alexandr/Tools/qt/5.13.1/ios/include/QtCore/qlist.h:1166: /Users/alexandr/Tools/qt/5.13.1/ios/include/QtCore/qstringlist.h:270:23: note: in instantiation of function template specialization 'QtPrivate::lastIndexOf<QString, QStringView>' requested here return QtPrivate::lastIndexOf<QString, QStringView>(*this, string, from); ^ In file included from /Users/alexandr/Projects/arboreus/arboreus_examples/qt/build-HandlingQMLFromCPP-Qt_5_13_1_for_iOS_Simulator-Debug/handlingqmlfromcpp_qml_plugin_import.cpp:3: In file included from /Users/alexandr/Tools/qt/5.13.1/ios/include/QtCore/QtPlugin:1: In file included from /Users/alexandr/Tools/qt/5.13.1/ios/include/QtCore/qplugin.h:44: In file included from /Users/alexandr/Tools/qt/5.13.1/ios/include/QtCore/qobject.h:49: /Users/alexandr/Tools/qt/5.13.1/ios/include/QtCore/qlist.h:1034:26: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32] return n - b; ~~~~~~ ~~^~~ In file included from /Users/alexandr/Projects/arboreus/arboreus_examples/qt/build-HandlingQMLFromCPP-Qt_5_13_1_for_iOS_Simulator-Debug/handlingqmlfromcpp_qml_plugin_import.cpp:3: In file included from /Users/alexandr/Tools/qt/5.13.1/ios/include/QtCore/QtPlugin:1: In file included from /Users/alexandr/Tools/qt/5.13.1/ios/include/QtCore/qplugin.h:44: In file included from /Users/alexandr/Tools/qt/5.13.1/ios/include/QtCore/qobject.h:49: In file included from /Users/alexandr/Tools/qt/5.13.1/ios/include/QtCore/qlist.h:1166: /Users/alexandr/Tools/qt/5.13.1/ios/include/QtCore/qstringlist.h:275:23: note: in instantiation of function template specialization 'QtPrivate::lastIndexOf<QString, QLatin1String>' requested here return QtPrivate::lastIndexOf<QString, QLatin1String>(*this, string, from);
Is it bug or not?
-
@bogong are you building for simulator? because iOS devices should be 64 bit, which should make the int 64 bit which should make the implicit cast moot
-
Hi,
What version of Xcode are you using ?