[pktools] 01/03: Add patch to fix build failure with GCC 5.

Sebastiaan Couwenberg sebastic at moszumanska.debian.org
Fri Jun 26 11:13:20 UTC 2015


This is an automated email from the git hooks/post-receive script.

sebastic pushed a commit to branch master
in repository pktools.

commit 6f1d70334f25346f06be8e4c775bb05d97a4f49f
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date:   Fri Jun 26 11:44:24 2015 +0200

    Add patch to fix build failure with GCC 5.
---
 debian/changelog                                   |  7 +++
 ...eclaration-may-not-have-default-arguments.patch | 61 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 3 files changed, 69 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index dd1894d..f09c40a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+pktools (2.6.3-2) UNRELEASED; urgency=medium
+
+  * Add patch to fix build failure with GCC 5.
+    (closes: #778065)
+
+ -- Bas Couwenberg <sebastic at debian.org>  Fri, 26 Jun 2015 11:40:08 +0200
+
 pktools (2.6.3-1) unstable; urgency=medium
 
   * Set the date embedded in man pages to the changelog date for
diff --git a/debian/patches/redeclaration-may-not-have-default-arguments.patch b/debian/patches/redeclaration-may-not-have-default-arguments.patch
new file mode 100644
index 0000000..e96bbf9
--- /dev/null
+++ b/debian/patches/redeclaration-may-not-have-default-arguments.patch
@@ -0,0 +1,61 @@
+Description: Don't use default arguments in redeclaration.
+ The 'Porting to GCC 4.9' guide documents the following:
+ "
+  Default arguments on redeclaration of member function of class template now rejected
+
+  GCC by default no longer accepts code such as:
+
+   template<class T>
+   struct A
+   {
+     void f(int);
+   };
+
+   template<class T>
+   void A<T>::f(int i=0) { }
+
+  This example now gives the following diagnostic:
+
+   r.cc:8:21: error: redeclaration of ‘void A<T>::f(int)’ may not have default arguments [-fpermissive]
+
+  The standard says the example is ill-formed, so GCC was changed to reject it for PR54485.
+  To fix the error the default argument must appear when the member function is first declared.
+ "
+ https://gcc.gnu.org/gcc-4.9/porting_to.html
+Author: Bas Couwenberg <sebastic at debian.org>
+Bug-Debian: https://bugs.debian.org/778065
+
+--- a/src/algorithms/FeatureSelector.h
++++ b/src/algorithms/FeatureSelector.h
+@@ -37,7 +37,7 @@ class FeatureSelector
+  public:
+   FeatureSelector(){};
+   ~FeatureSelector(){};
+-  template<class T> double forward(std::vector< Vector2d<T> >& v, CostFactory& theCostFactory, std::list<int>& subset, int maxFeatures, short verbose=0);
++  template<class T> double forward(std::vector< Vector2d<T> >& v, CostFactory& theCostFactory, std::list<int>& subset, int maxFeatures=0, short verbose=0);
+   template<class T> double backward(std::vector< Vector2d<T> >& v, CostFactory& theCostFactory, std::list<int>& subset, int minFeatures, short verbose=0);
+   template<class T> double floating(std::vector< Vector2d<T> >& v, CostFactory& theCostFactory, std::list<int>& subset, int maxFeatures=0, double epsilon=0.001, short verbose=0);
+   template<class T> double bruteForce(std::vector< Vector2d<T> >& v, CostFactory& theCostFactory, std::list<int>& subset, int maxFeatures=0, short verbose=0);
+@@ -45,11 +45,11 @@ class FeatureSelector
+   private:
+     template<class T> double addFeature(std::vector< Vector2d<T> >& v, CostFactory& theCostFactory, std::list<int>& subset, short verbose=0);
+   template<class T> double removeFeature(std::vector< Vector2d<T> >& v, CostFactory& theCostFactory, std::list<int>& subset, int& r, short verbose=0);  
+-  template<class T> double forwardUnivariate(std::vector< Vector2d<T> >& v, CostFactory& theCostFactory, std::list<int>& subset, int maxFeatures, short verbose=0);
++  template<class T> double forwardUnivariate(std::vector< Vector2d<T> >& v, CostFactory& theCostFactory, std::list<int>& subset, int maxFeatures=0, short verbose=0);
+ };
+ 
+ //sequential forward selection Univariate (N single best features)
+-template<class T> double FeatureSelector::forwardUnivariate(std::vector< Vector2d<T> >& v, CostFactory& theCostFactory, std::list<int>& subset, int maxFeatures=0, short verbose){
++template<class T> double FeatureSelector::forwardUnivariate(std::vector< Vector2d<T> >& v, CostFactory& theCostFactory, std::list<int>& subset, int maxFeatures, short verbose){
+   int maxLevels=v[0][0].size();
+   if(!maxFeatures)
+     maxFeatures=maxLevels;
+@@ -108,7 +108,7 @@ template<class T> double FeatureSelector
+ }
+ 
+ //sequential forward selection Multivariate (Combination of N best features)
+-template<class T> double FeatureSelector::forward(std::vector< Vector2d<T> >& v, CostFactory& theCostFactory, std::list<int>& subset, int maxFeatures=0, short verbose){
++template<class T> double FeatureSelector::forward(std::vector< Vector2d<T> >& v, CostFactory& theCostFactory, std::list<int>& subset, int maxFeatures, short verbose){
+   //Select feature with the best value (get maximal cost for 1 feature)
+   double maxCost=0;
+   int maxLevels=v[0][0].size();
diff --git a/debian/patches/series b/debian/patches/series
index e9e0975..2bef6d8 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 automake-subdir-objects.patch
+redeclaration-may-not-have-default-arguments.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/pktools.git



More information about the Pkg-grass-devel mailing list