Skip to content

Compilation warnings for the sfos3.2 branch #231

@Olf0

Description

@Olf0

@mentaljam, this is not at all urgent, all seems to be working fine, but sometimes warnings point to real issues, hence I would appreciate if you take a look at these some day and either assure or dismiss my preliminary conclusion(s). Please do not start a deeper analysis; only if you do have the impression these warnings indicate a flaw in your code, analysing this makes sense.

This issue also exists there for documenting these two compiler warnings, so others do not have to research these again (first observed in #191, section 3).


When Storeman is being build by the GitHub-action build-runner using the 3.1.0.12 build target, I observe two compiler warnings.

1. At src/orncommentsmodel.cpp, line 168

compiling src/orncommentsmodel.cpp
src/orncommentsmodel.cpp: In member function 'QJsonObject OrnCommentsModel::processReply(QNetworkReply*)':
src/orncommentsmodel.cpp:168:27: warning: missing initializer for member 'QJsonParseError::offset' [-Wmissing-field-initializers]
     QJsonParseError error{};
                           ^
src/orncommentsmodel.cpp:168:27: warning: missing initializer for member 'QJsonParseError::error' [-Wmissing-field-initializers]

See https://github.com/storeman-developers/harbour-storeman/runs/5547287920?check_suite_focus=true#step:4:116

The code for this object is the same in devel, master, and all three release branches, see devel, sfos3.2, sfos3.3 and sfos4.2.

Well, it is just a warning and everything seems to be working fine WRT the comment functions in Storeman on SFOS 3.2.1. Hence my uneducated guess is that this is caused by a compiler flaw.

2. At src/ornpm.cpp, line 573

compiling src/ornpm.cpp
src/ornpm.cpp: In member function 'OrnInstalledPackageList OrnPmPrivate::prepareInstalledPackages(const QString&)':
src/ornpm.cpp:753:72: warning: 'maybe_unused' attribute directive ignored [-Wattributes]
     processSolvables(true, [&ornPackages]([[maybe_unused]] const auto &alias, auto spool) {
                                                                        ^
src/ornpm.cpp: In instantiation of 'OrnPmPrivate::prepareInstalledPackages(const QString&)::<lambda(const auto:6&, auto:7)> [with auto:6 = QString; auto:7 = _Pool*]':
/srv/mer/toolings/SailfishOS-3.1.0.12/opt/cross/armv7hl-meego-linux-gnueabi/include/c++/4.9.4/functional:2150:64:   required by substitution of 'template<class _Res, class ... _ArgTypes> template<class _Functor> using _Invoke = decltype (std::__callable_functor(declval<_Functor&>())((declval<_ArgTypes>)()...)) [with _Functor = OrnPmPrivate::prepareInstalledPackages(const QString&)::<lambda(const auto:6&, auto:7)>; _Res = void; _ArgTypes = {const QString&, _Pool*}]'
/srv/mer/toolings/SailfishOS-3.1.0.12/opt/cross/armv7hl-meego-linux-gnueabi/include/c++/4.9.4/functional:2226:9:   required by substitution of 'template<class _Functor, class> std::function<_Res(_ArgTypes ...)>::function(_Functor) [with _Functor = OrnPmPrivate::prepareInstalledPackages(const QString&)::<lambda(const auto:6&, auto:7)>; <template-parameter-1-2> = <missing>]'
src/ornpm.cpp:759:6:   required from here
src/ornpm.cpp:753:72: warning: unused parameter 'alias' [-Wunused-parameter]

See https://github.com/storeman-developers/harbour-storeman/runs/5547287920?check_suite_focus=true#step:4:133

The code for this function is the same in devel, master, and all three release branches, see devel, sfos3.2, sfos3.3 and sfos4.2.

Edit: But the code at two other locations in this source file differs for the sfos3.2 branch, see master...sfos3.2#diff-9f50c3406e2d09d9349a14e3d60e9fa85dc4ec5a6cad88f180d06a3081a6cedb And it is at both places solely a [[maybe_unused]] marker, which makes up the whole difference. (/edit)

Well, it is just a warning and everything seems to be working fine WRT the RPM repository management in Storeman on SFOS 3.2.1. Hence my uneducated guess is that this is also caused by a compiler flaw.

3. Preliminary conclusion

On the other release branches these source files are compiled without warnings, see src/orncommentsmodel.cpp@sfos3.3, src/orncommentsmodel.cpp@sfos4.2 and src/ornpm.cpp@sfos3.3, src/ornpm.cpp@sfos4.2.

Hence my uneducated guess is that both warnings are caused by compiler flaws when using the 3.1.0.12 build target.

Thus it seems to be the same compiling behaviour as on the other two release branches with the code from the sfos3.2 branch (for the object and the function the older compilers complain about), when compiled with newer compilers (as the other release branches do by default). Another indication that this is just a compiler flaw.

Though looking at the release notes for SDK 3.0 and SDK 3.2 (an SDK 3.1 release does not seem to exist), I cannot see any statement about a changed compiler version. Maybe Jolla forgot to document it (as so often).

Metadata

Metadata

Assignees

No one assigned

    Labels

    information neededMore information is needed to address thisquestionQuestions and answers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions