Bug#746824: Patch aptitude: ftbfs with GCC-4.9
Hello,
I have put together a patch to bug http://bugs.debian.org/746824
It consists of removal of unused funtions.
There is also a reference to a private member, the Patch simply comments
out the faulty code, not a nice fix.
With patch applied the codes builds using dpkg-buildpackage in
jessie/sid.
Comments welcome.
Description: gcc 4.9 FTBFS corrections
-Werror=unused-function
serialize_pattern_list in src/generic/apt/matching/serialize.cc
strncase_eq_with_translation in src/main.cc
transcode in tests/test_cmdline_download_status_display.cc
Unused functions removed.
Private member apply in strip_shared_ptrs_result:
BOOST_STATIC_ASSERT code commented out. Needs a better solution.
Author: David Westberg <westberg.david@bredband.net>
Bug-Debian: http://bugs.debian.org/746824
Index: aptitude-0.6.10/src/generic/apt/matching/serialize.cc
===================================================================
--- aptitude-0.6.10.orig/src/generic/apt/matching/serialize.cc 2014-05-31 17:37:36.000000000 +0200
+++ aptitude-0.6.10/src/generic/apt/matching/serialize.cc 2014-05-31 17:37:49.000000000 +0200
@@ -94,23 +94,6 @@
out.put(')');
}
- void serialize_pattern_list(const std::vector<ref_ptr<pattern> > &patterns,
- std::ostream &out,
- std::vector<std::string> &variable_name_stack)
- {
- bool first = true;
- for(std::vector<ref_ptr<pattern> >::const_iterator it =
- patterns.begin(); it != patterns.end(); ++it)
- {
- if(first)
- first = false;
- else
- out << ", ";
-
- serialize_pattern(*it, out, variable_name_stack);
- }
- }
-
void serialize_deptype(pkgCache::Dep::DepType deptype,
std::ostream &out)
{
Index: aptitude-0.6.10/src/main.cc
===================================================================
--- aptitude-0.6.10.orig/src/main.cc 2014-05-31 17:37:36.000000000 +0200
+++ aptitude-0.6.10/src/main.cc 2014-05-31 17:37:49.000000000 +0200
@@ -359,16 +359,6 @@
namespace
{
- bool strncase_eq_with_translation(const std::string &s1, const char *s2)
- {
- if(strcasecmp(s1.c_str(), s2) == 0)
- return true;
- else if(strcasecmp(s1.c_str(), _(s2)) == 0)
- return true;
- else
- return false;
- }
-
class log_level_map
{
std::map<std::string, log_level> levels;
Index: aptitude-0.6.10/tests/test_cmdline_download_status_display.cc
===================================================================
--- aptitude-0.6.10.orig/tests/test_cmdline_download_status_display.cc 2014-05-31 17:37:36.000000000 +0200
+++ aptitude-0.6.10/tests/test_cmdline_download_status_display.cc 2014-05-31 17:37:49.000000000 +0200
@@ -59,11 +59,6 @@
const wchar_t two_column_char = L'-';
// Locally alias transcode to always use UTF-8.
- std::wstring transcode(const std::string &s)
- {
- return cw::util::transcode(s, "UTF-8");
- }
-
std::string transcode(const std::wstring &s)
{
return cw::util::transcode(s, "UTF-8");
Index: aptitude-0.6.10/tests/test_parsers.cc
===================================================================
--- aptitude-0.6.10.orig/tests/test_parsers.cc 2014-05-31 17:37:36.000000000 +0200
+++ aptitude-0.6.10/tests/test_parsers.cc 2014-05-31 17:37:49.000000000 +0200
@@ -81,8 +81,9 @@
};
};
-BOOST_STATIC_ASSERT( (boost::is_same<std::vector<std::vector<int> >,
- strip_shared_ptrs_result::apply<boost::shared_ptr<std::vector<std::vector<boost::shared_ptr<int> > > > >::type>::value) );
+//apply is private
+//BOOST_STATIC_ASSERT( (boost::is_same<std::vector<std::vector<int> >,
+// strip_shared_ptrs_result::apply<boost::shared_ptr<std::vector<std::vector<boost::shared_ptr<int> > > > >::type>::value) );
template<typename T>
T strip_shared_ptrs(const T &t)
Reply to: