ubports/ubuntu-ui-toolkit

Several compilation warnings

Closed this issue · 0 comments

z3ntu commented

First warning:

ucurihandler.cpp: In constructor 'UCUriHandler::UCUriHandler()':
ucurihandler.cpp:78:73: error: missing sentinel in function call [-Werror=format=]
     char* path = nih_dbus_path(NULL, "", applicationId.constData(), NULL);
                                                                         ^

My proposed fix: 15f75fc

Second warning:

plugin/uctestcase.cpp: In constructor 'UbuntuTestCase::UbuntuTestCase(const QString&, QQuickView::ResizeMode, bool, QWindow*)':
plugin/uctestcase.cpp:55:37: error: ignoring return value of 'bool QTest::qWaitForWindowExposed(QWindow*, int)', declared with attribute nodiscard [-Werror=unused-result]
         QTest::qWaitForWindowExposed(this);
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
In file included from /usr/include/QtTest/qtest.h:349,
                 from /usr/include/QtTest/QtTest:7,
                 from plugin/uctestcase.h:24,
                 from plugin/uctestcase.cpp:19:
/usr/include/QtTest/qtestsystem.h:134:42: note: declared here
     Q_REQUIRED_RESULT inline static bool qWaitForWindowExposed(QWindow *window, int timeout = 5000)
                                          ^~~~~~~~~~~~~~~~~~~~~

There are likely more, but I don't know how to disable Werror (for now sed -i 's|warning_clean|warn_off|' "$builddir"/.qmake.conf worked in ignoring the warnings), so I couldn't check more.