By default, Bugzilla does not search the list of RESOLVED bugs.
You can force it to do so by putting the upper-case word ALL in front of your search query, e.g.: ALL tdelibs
We recommend searching for bugs this way, as you may discover that your bug has already been resolved and fixed in a later release.
Bug 2832 - Digikam build fails in matrix.cpp with gcc7
Summary: Digikam build fails in matrix.cpp with gcc7
Status: RESOLVED FIXED
Alias: None
Product: TDE
Classification: Unclassified
Component: non-core programs (show other bugs)
Version: R14.0.x [Trinity]
Hardware: All Slackware 14
: P5 major
Assignee: Timothy Pearson
URL:
Depends on:
Blocks:
 
Reported: 2017-09-15 04:35 CDT by Ray Vine
Modified: 2017-10-04 06:04 CDT (History)
2 users (show)

See Also:
Compiler Version:
TDE Version String:
Application Version:
Application Name:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ray Vine 2017-09-15 04:35:13 CDT
This build error occurs building digikam R14.0.4

In file included from ../../../../../digikam/imageplugins/coreplugin/sharpnesseditor/matrix.cpp:35:0:
/usr/include/stdlib.h:751:12: error: expected unqualified-id before ‘int’
 extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
            ^
/usr/include/stdlib.h:751:12: error: expected ‘)’ before ‘int’
/usr/include/stdlib.h:751:12: error: expected ‘)’ before ‘int’
In file included from /usr/include/c++/7.2.0/cmath:47:0,
                 from ../../../../../digikam/imageplugins/coreplugin/sharpnesseditor/matrix.cpp:41:
/usr/include/c++/7.2.0/bits/std_abs.h:52:11: error: ‘::abs’ has not been declared
   using ::abs;
           ^~~

Builds ok with gcc-5.4.0
Comment 1 Ray Vine 2017-10-04 06:04:27 CDT
I think I've found a solution but I'm not a programmer so this is just my interpretation of https://gcc.gnu.org/gcc-7/porting_to.html#cmath

Digikam built with gcc-7.2.0 and gcc-5.4.0 using this patch. The sharpen filter works so I guess it's OK.

--- applications/digikam/digikam/imageplugins/coreplugin/sharpnesseditor/clapack/f2c.h
+++ applications/digikam/digikam/imageplugins/coreplugin/sharpnesseditor/clapack/f2c.h
@@ -157 +156,0 @@
-#define abs(x) ((x) >= 0 ? (x) : -(x))
--- applications/digikam/digikam/imageplugins/coreplugin/sharpnesseditor/matrix.cpp
+++ applications/digikam/digikam/imageplugins/coreplugin/sharpnesseditor/matrix.cpp
@@ -32,0 +33,5 @@
+// C++ includes.
+#include <stdlib.h>
+#include <cmath>
+using ::abs;
+
@@ -38,4 +42,0 @@
-
-// C++ includes.
-
-#include <cmath>