Package: dssp
Version: 2.0.4-1
Severity: serious
User: debian-...@lists.debian.org
Usertags: ftbfs-gcc-4.7
Tags: patch

dssp fails to build with gcc-4-7 in unstable:

g++ -MD -c -o obj/utils.o src/utils.cpp -g -O2 -fstack-protector
--param=ssp-buffer-size=4 -Wformat -Werror=format-security -iquote src
-g -Wall -Wno-multichar -pthread -O3 -DUSE_COMPRESSION -DLINUX
-DVERSION='"2.0.4"' -DNDEBUG
In file included from src/primitives-3d.cpp:17:0:
src/matrix.h: In instantiation of 'matrix<T> operator-(const
matrix_base<T>&, const matrix_base<T>&) [with T = double]':
src/primitives-3d.cpp:336:25:   required from here
src/matrix.h:313:79: error: 'min' was not declared in this scope, and no
declarations were found by argument-dependent lookup at the point of
instantiation [-fpermissive]
In file included from /usr/include/c++/4.7/algorithm:62:0,
                 from /usr/include/c++/4.7/valarray:40,
                 from src/primitives-3d.cpp:10:
/usr/include/c++/4.7/bits/stl_algobase.h:233:5: note: 'template<class
_Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&,
_Compare)' declared here, later in the translation unit
In file included from src/primitives-3d.cpp:17:0:
src/matrix.h:313:79: error: 'min' was not declared in this scope, and no
declarations were found by argument-dependent lookup at the point of
instantiation [-fpermissive]
In file included from /usr/include/c++/4.7/algorithm:62:0,
                 from /usr/include/c++/4.7/valarray:40,
                 from src/primitives-3d.cpp:10:
/usr/include/c++/4.7/bits/stl_algobase.h:233:5: note: 'template<class
_Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&,
_Compare)' declared here, later in the translation unit
make[1]: *** [obj/primitives-3d.o] Error 1

attached a patch fixing the issue.
--- dssp-2.0.4.orig/src/matrix.h
+++ dssp-2.0.4/src/matrix.h
@@ -14,6 +14,7 @@
 #include <istream>
 #include <cassert>
 #include <stdexcept>
+#include <algorithm>
 
 // --------------------------------------------------------------------
 // uBlas compatible matrix types
@@ -310,7 +311,7 @@ matrix<T> operator*(const matrix_base<T>
 template<typename T>
 matrix<T> operator-(const matrix_base<T>& lhs, const matrix_base<T>& rhs)
 {
-	matrix<T> result(min(lhs.dim_m(), rhs.dim_m()), min(lhs.dim_n(), rhs.dim_n()));
+	matrix<T> result(std::min(lhs.dim_m(), rhs.dim_m()), std::min(lhs.dim_n(), rhs.dim_n()));
 	
 	for (uint32 i = 0; i < result.dim_m(); ++i)
 	{

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to