Bug 4462

Summary: kdenlive FTBFS with gcc-7
Product: Fedora Reporter: leigh scott <leigh123linux>
Component: kdenliveAssignee: Rex Dieter <rdieter>
Status: RESOLVED FIXED    
Severity: enhancement CC: hobbes1069, ry, sergio
Priority: P1    
Version: 26   
Hardware: x86_64   
OS: GNU/Linux   
namespace:
Attachments: build fix

Description leigh scott 2017-02-21 12:25:03 CET
http://koji.rpmfusion.org/kojifiles/work/tasks/3124/83124/build.log

/builddir/build/BUILD/kdenlive-16.12.2/src/scopes/audioscopes/spectrogram.cpp:248:111: error: call of overloaded 'abs(unsigned int)' is ambiguous
                 hideText = m_aTrackMouse->isChecked() && m_mouseWithinWidget && abs(x-(leftDist + mouseX + 20)) < (int) minDistX + 16
                                                                                                               ^
In file included from /usr/include/c++/7/cstdlib:75:0,
                 from /usr/include/c++/7/bits/stl_algo.h:59,
                 from /usr/include/c++/7/algorithm:62,
                 from /usr/include/qt5/QtCore/qglobal.h:94,
                 from /usr/include/qt5/QtGui/qwindowdefs.h:43,
                 from /usr/include/qt5/QtWidgets/qwidget.h:43,
                 from /usr/include/qt5/QtWidgets/QWidget:1,
                 from /builddir/build/BUILD/kdenlive-16.12.2/src/scopes/audioscopes/abstractaudioscopewidget.h:15,
                 from /builddir/build/BUILD/kdenlive-16.12.2/src/scopes/audioscopes/spectrogram.h:29,
                 from /builddir/build/BUILD/kdenlive-16.12.2/src/scopes/audioscopes/spectrogram.cpp:11:
/usr/include/stdlib.h:751:12: note: candidate: int abs(int)
 extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
            ^~~
In file included from /usr/include/c++/7/cstdlib:77:0,
                 from /usr/include/c++/7/bits/stl_algo.h:59,
                 from /usr/include/c++/7/algorithm:62,
                 from /usr/include/qt5/QtCore/qglobal.h:94,
                 from /usr/include/qt5/QtGui/qwindowdefs.h:43,
                 from /usr/include/qt5/QtWidgets/qwidget.h:43,
                 from /usr/include/qt5/QtWidgets/QWidget:1,
                 from /builddir/build/BUILD/kdenlive-16.12.2/src/scopes/audioscopes/abstractaudioscopewidget.h:15,
                 from /builddir/build/BUILD/kdenlive-16.12.2/src/scopes/audioscopes/spectrogram.h:29,
                 from /builddir/build/BUILD/kdenlive-16.12.2/src/scopes/audioscopes/spectrogram.cpp:11:
/usr/include/c++/7/bits/std_abs.h:56:3: note: candidate: long int std::abs(long int)
   abs(long __i) { return __builtin_labs(__i); }
   ^~~
/usr/include/c++/7/bits/std_abs.h:61:3: note: candidate: long long int std::abs(long long int)
   abs(long long __x) { return __builtin_llabs (__x); }
   ^~~
/usr/include/c++/7/bits/std_abs.h:70:3: note: candidate: constexpr double std::abs(double)
   abs(double __x)
   ^~~
/usr/include/c++/7/bits/std_abs.h:74:3: note: candidate: constexpr float std::abs(float)
   abs(float __x)
   ^~~
/usr/include/c++/7/bits/std_abs.h:78:3: note: candidate: constexpr long double std::abs(long double)
   abs(long double __x)
   ^~~
/usr/include/c++/7/bits/std_abs.h:84:3: note: candidate: constexpr __int128 std::abs(__int128)
   abs(__GLIBCXX_TYPE_INT_N_0 __x) { return __x >= 0 ? __x : -__x; }
   ^~~
/usr/include/c++/7/bits/std_abs.h:102:3: note: candidate: constexpr __float128 std::abs(__float128)
   abs(__float128 __x)
   ^~~
/builddir/build/BUILD/kdenlive-16.12.2/src/scopes/audioscopes/spectrogram.cpp:276:107: error: call of overloaded 'abs(unsigned int)' is ambiguous
             hideText = m_aTrackMouse->isChecked() && m_mouseWithinWidget && abs(x-(leftDist + mouseX + 30)) < (int) minDistX
                                                                                                           ^
In file included from /usr/include/c++/7/cstdlib:75:0,
                 from /usr/include/c++/7/bits/stl_algo.h:59,
                 from /usr/include/c++/7/algorithm:62,
                 from /usr/include/qt5/QtCore/qglobal.h:94,
                 from /usr/include/qt5/QtGui/qwindowdefs.h:43,
                 from /usr/include/qt5/QtWidgets/qwidget.h:43,
                 from /usr/include/qt5/QtWidgets/QWidget:1,
                 from /builddir/build/BUILD/kdenlive-16.12.2/src/scopes/audioscopes/abstractaudioscopewidget.h:15,
                 from /builddir/build/BUILD/kdenlive-16.12.2/src/scopes/audioscopes/spectrogram.h:29,
                 from /builddir/build/BUILD/kdenlive-16.12.2/src/scopes/audioscopes/spectrogram.cpp:11:
/usr/include/stdlib.h:751:12: note: candidate: int abs(int)
 extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
            ^~~
In file included from /usr/include/c++/7/cstdlib:77:0,
                 from /usr/include/c++/7/bits/stl_algo.h:59,
                 from /usr/include/c++/7/algorithm:62,
                 from /usr/include/qt5/QtCore/qglobal.h:94,
                 from /usr/include/qt5/QtGui/qwindowdefs.h:43,
                 from /usr/include/qt5/QtWidgets/qwidget.h:43,
                 from /usr/include/qt5/QtWidgets/QWidget:1,
                 from /builddir/build/BUILD/kdenlive-16.12.2/src/scopes/audioscopes/abstractaudioscopewidget.h:15,
                 from /builddir/build/BUILD/kdenlive-16.12.2/src/scopes/audioscopes/spectrogram.h:29,
                 from /builddir/build/BUILD/kdenlive-16.12.2/src/scopes/audioscopes/spectrogram.cpp:11:
/usr/include/c++/7/bits/std_abs.h:56:3: note: candidate: long int std::abs(long int)
   abs(long __i) { return __builtin_labs(__i); }
   ^~~
/usr/include/c++/7/bits/std_abs.h:61:3: note: candidate: long long int std::abs(long long int)
   abs(long long __x) { return __builtin_llabs (__x); }
   ^~~
/usr/include/c++/7/bits/std_abs.h:70:3: note: candidate: constexpr double std::abs(double)
   abs(double __x)
   ^~~
/usr/include/c++/7/bits/std_abs.h:74:3: note: candidate: constexpr float std::abs(float)
   abs(float __x)
   ^~~
/usr/include/c++/7/bits/std_abs.h:78:3: note: candidate: constexpr long double std::abs(long double)
   abs(long double __x)
   ^~~
/usr/include/c++/7/bits/std_abs.h:84:3: note: candidate: constexpr __int128 std::abs(__int128)
   abs(__GLIBCXX_TYPE_INT_N_0 __x) { return __x >= 0 ? __x : -__x; }
   ^~~
/usr/include/c++/7/bits/std_abs.h:102:3: note: candidate: constexpr __float128 std::abs(__float128)
   abs(__float128 __x)
   ^~~
make[2]: *** [src/CMakeFiles/kdenlive.dir/build.make:3128: src/CMakeFiles/kdenlive.dir/scopes/audioscopes/spectrogram.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory '/builddir/build/BUILD/kdenlive-16.12.2/x86_64-redhat-linux-gnu'
make[1]: *** [CMakeFiles/Makefile2:554: src/CMakeFiles/kdenlive.dir/all] Error 2
make[1]: Leaving directory '/builddir/build/BUILD/kdenlive-16.12.2/x86_64-redhat-linux-gnu'
make: *** [Makefile:131: all] Error 2
make: Leaving directory '/builddir/build/BUILD/kdenlive-16.12.2/x86_64-redhat-linux-gnu'
error: Bad exit status from /var/tmp/rpm-tmp.8yP1Ie (%build)
    Bad exit status from /var/tmp/rpm-tmp.8yP1Ie (%build)
Comment 1 Sérgio Basto 2017-02-21 23:29:01 CET
we should (IMHO) upstream this bug , upstream will have to fix it soon or later. 

Thanks.
Comment 2 leigh scott 2017-02-22 01:52:49 CET
Created attachment 1743 [details]
build fix

(In reply to Sérgio Basto from comment #1)
> we should (IMHO) upstream this bug , upstream will have to fix it soon or
> later. 
> 
> Thanks.

I'm not registered at kde bug tracker so I'm unlikely to do that.

A possible fix for this is to replace abs with fabs though I'm not sure it's correct.
Comment 3 Sérgio Basto 2017-02-22 03:16:26 CET
Also not sure that is correct fixed , we also had similar issues with gcc6 , I wrote in this entry http://stackoverflow.com/a/7415247/778517  

@Sérgio I think you should just remove the call to abs, since uint32_t is unsigned. (Instead you're implicitly casting uint32_t to double for fabs(double) and then I assume casting the result back to an integer!)  

error: call of overloaded 'abs(unsigned int)'
if int is unsigned is already absolute, isn't it ?
Comment 4 leigh scott 2017-03-12 08:48:54 CET
Fixed for now

https://pkgs.rpmfusion.org/cgit/free/kdenlive.git/tree/gcc7.patch