Skip to content

settings: fix -Wlto-type-mismatch in NetworkManager::checkVersion decl

Sam James requested to merge thesamesam/networkmanager-qt:lto-fix into master

The actual definition of NetworkManager::checkVersion only ever returns a bool and every consumer expects a bool. Fix the declaration to avoid a -Wlto-type-mismatch warning and possible miscompilation with LTO:

src/settings/connectionsettings.cpp:57:12: error: type of ‘checkVersion’ does not match original declaration [-Werror=lto-type-mismatch]
   57 | extern int checkVersion(const int x, const int y, const int z);
      |            ^
src/manager.cpp:966:6: note: return value type mismatch
  966 | bool NetworkManager::checkVersion(const int x, const int y, const int z)
      |      ^
src/manager.cpp:966:6: note: type ‘bool’ should match type ‘int’
src/manager.cpp:966:6: note: ‘checkVersion’ was previously declared here
src/manager.cpp:966:6: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used

Bug: https://bugs.gentoo.org/895580

Merge request reports

Loading