Fix build of kwin with GCC6
ClosedPublic

Authored by rwooninck on Mar 28 2017, 7:52 PM.

Details

Summary

KWIN in its current form, fails to build due to the error regarding overload on abs(qReal). This patch fixes the build issue on openSUSE and is actually very simple.

Test Plan

Tested by building kwin on openSUSE TW which has GCC6 v6.3.1. The build now completes succesfully.

Kwin_x11 runs normally on the system, but I cannot test the gestures unfortunately

Diff Detail

Repository
R108 KWin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
rwooninck created this revision.Mar 28 2017, 7:52 PM
Restricted Application added a project: KWin. · View Herald TranscriptMar 28 2017, 7:52 PM
Restricted Application added a subscriber: kwin. · View Herald Transcript
fvogt added a subscriber: fvogt.Mar 28 2017, 8:03 PM
rwooninck edited the test plan for this revision. (Show Details)Mar 28 2017, 8:05 PM
apol accepted this revision.Mar 29 2017, 11:50 AM
apol added a subscriber: apol.

I have exactly the same problem with clang:

/home/apol/devel/frameworks/kwin/gestures.cpp:159:35: error: call to 'abs' is ambiguous
    if (std::abs(delta.width()) > std::abs(delta.height())) {
                                  ^~~~~~~~
/usr/include/stdlib.h:751:12: note: candidate function
extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
           ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/6.3.1/../../../../include/c++/6.3.1/cstdlib:172:3: note: candidate function
  abs(long __i) { return __builtin_labs(__i); }
  ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/6.3.1/../../../../include/c++/6.3.1/cstdlib:180:3: note: candidate function
  abs(long long __x) { return __builtin_llabs (__x); }
This revision is now accepted and ready to land.Mar 29 2017, 11:50 AM
This revision was automatically updated to reflect the committed changes.