Qt 5.13 warnings when build for iOS. How to fix it?



  • Hello all!
    Just tried to build simple application for iOS on Qt 5.13 and got this warnings:

    1_1567337568295_Screenshot 2019-09-01 at 14.32.01.png
    0_1567337568295_Screenshot 2019-09-01 at 14.31.50.png
    0_1567337903126_Screenshot 2019-09-01 at 14.37.58.png

    How to fix it not suppress? There are a lot of them. On 5.12.4 not appeared.



  • Make the conversion explicit using a suitable cast.

    Next time: post the whole warning message and the code which the warning concerns



  • @mvuori Legally I have no option to change anything because it's in Qt sources (there are the mentioning of the file in the sources, it's in QtCore not in my application) and this is the whole message that I got ... And only in iOS build.



  • The same trouble appeared on Qt 5.12.4 in Qt Test and again only for iOS build.

    0_1567504858362_Screenshot 2019-09-03 at 12.59.36.png


  • Moderators

    @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?



  • @j-hilk Just tried to build on Qt 5.13.1 application for iOS device - got 58 warnings about implicit conversion. Device the same iPhone SE.


  • Lifetime Qt Champion

    Hi,

    What version of Xcode are you using ?


 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.