[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Help with gcc-4.7 needed (Was: poco: FTBFS with multiarch libmysqlclient-dev)



Hi Andreas

Reading the error message, it seems that there is a forward-declaration
of replaceInPlace(...) is missing before it is used in String.h:448.

It seems like simply reversing the order of declaration should fix the
problem: See the attached (modified) dpatch.

Michael

On 07/26/2012 02:45 PM, Andreas Tille wrote:
> Hi,
> 
> I tried to apply the patch that is supposed to solve the problem below
> but I was running in another problem which sounds quite familiar from
> other gcc-4.7 issues.  I tried to fix the problem in Git
> 
>    git+ssh://git.debian.org/git/collab-maint/poco.git
> 
> and created a branch NMU/1.3.6p1-1.1 where I created a dpatch file
> debian/patches/gcc-4.7.dpatch which unfortunately just reiterates
> the original problem and ends up in
> 
> /tmp/buildd/poco-1.3.6p1/Foundation/include/Poco/String.h: In instantiation of 'S Poco::replace(const S&, const typename S::value_type*, const typename S::value_type*, typename S::size_type) [with S = std::    basic_string<char>; typename S::value_type = char; typename S::size_type = long unsigned int]':
> src/X509Certificate.cpp:175:55:   required from here
> /tmp/buildd/poco-1.3.6p1/Foundation/include/Poco/String.h:448:2: error: 'replaceInPlace' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of              instantiation [-fpermissive]
> /tmp/buildd/poco-1.3.6p1/Foundation/include/Poco/String.h:480:4: note: 'template<class S> S& Poco::replaceInPlace(S&, const S&, const S&, typename S::size_type)' declared here, later in the translation unit
> 
> 
> Unfortunately my C++ knowledge is to limited to find an easy clue how to
> fix this and would be more than happy if somebody could provide some fix.
> 
> BTW, it seems to me that libpoco development only happens in experimental
> and unstable does not deserve the attention it would need.  Please help
> fixing the problem to make sure the reverse depends can stay in testing.
> 
> Kind regards
> 
>        Andreas.
> 
> ----- Forwarded message from Andreas Tille <andreas@an3as.eu> -----
> 
> Date: Thu, 26 Jul 2012 14:23:26 +0200
> From: Andreas Tille <andreas@an3as.eu>
> To: Mathieu Malaterre <mathieu.malaterre@gmail.com>, 680798@bugs.debian.org,
> 	Krzysztof Burghardt <krzysztof@burghardt.pl>,
> 	650059@bugs.debian.org
> Subject: Re: Bug#680798: sitplus: FTBFS: build-dependency not installable:
> 
> Hi Krzysztof,
> 
> there is a long standing (>6 month) RC bug filed against poco including
> a patch for this problem.  When applying the patch and trying to build
> the package I realised another FTBFS problem when building with gcc-4.7.
> I'm currently trying to fix this problem and if I succeede I will upload
> to DELAYED/2.  Otherwise I'll ask for help on debian-mentors and will
> NMU-upload once the problem is solved.
> 
> Kind regards
> 
>         Andreas.
> 
> On Thu, Jul 26, 2012 at 11:52:33AM +0200, Mathieu Malaterre wrote:
>> 'lo
>>
>> On Thu, Jul 26, 2012 at 11:47 AM, Andreas Tille <tille@debian.org> wrote:
>>> On Thu, Jul 26, 2012 at 11:38:24AM +0200, Mathieu Malaterre wrote:
>>>> I believe this is because libpoco-dev was removed from testing:
>>>> http://packages.qa.debian.org/p/poco/news/20120619T163916Z.html
>>>
>>> I came to the same conclusion but I have no idea how we (in terms
>>> of sitplus maintainers) could solve this.
>>
>> The patch looks straighfoward to apply but for some reason was never
>> applied. So I simply ping'd the maintainers again:
>>
>> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=650059#16
>>
>> We'll see.
>> -- 
>> Mathieu
> 

#! /bin/sh /usr/share/dpatch/dpatch-run
## gcc-4.7.dpatch by Andreas Tille <tille@debian.org>
##
## DP: Try to fix Build issue with gcc-4.7 ... but failed :-(

@DPATCH@
diff -urNad poco-1.3.6p1~/Foundation/include/Poco/String.h poco-1.3.6p1/Foundation/include/Poco/String.h
--- poco-1.3.6p1~/Foundation/include/Poco/String.h
+++ poco-1.3.6p1/Foundation/include/Poco/String.h
@@ -451,12 +451,13 @@
 
 
 template <class S>
-S& replaceInPlace(S& str, const S& from, const S& to, typename S::size_type start = 0)
+S& replaceInPlace(S& str, const typename S::value_type* from, const typename S::value_type* to, typename S::size_type start = 0)
 {
-	poco_assert (from.size() > 0);
-	
+	poco_assert (*from);
+
 	S result;
 	typename S::size_type pos = 0;
+	typename S::size_type fromLen = std::strlen(from);
 	result.append(str, 0, start);
 	do
 	{
@@ -465,7 +466,7 @@
 		{
 			result.append(str, start, pos - start);
 			result.append(to);
-			start = pos + from.length();
+			start = pos + fromLen;
 		}
 		else result.append(str, start, str.size() - start);
 	}
@@ -476,13 +477,12 @@
 
 
 template <class S>
-S& replaceInPlace(S& str, const typename S::value_type* from, const typename S::value_type* to, typename S::size_type start = 0)
+S& replaceInPlace(S& str, const S& from, const S& to, typename S::size_type start = 0)
 {
-	poco_assert (*from);
-
+	poco_assert (from.size() > 0);
+	
 	S result;
 	typename S::size_type pos = 0;
-	typename S::size_type fromLen = std::strlen(from);
 	result.append(str, 0, start);
 	do
 	{
@@ -491,7 +491,7 @@
 		{
 			result.append(str, start, pos - start);
 			result.append(to);
-			start = pos + fromLen;
+			start = pos + from.length();
 		}
 		else result.append(str, start, str.size() - start);
 	}

Reply to: