Skip to content

Commit

Permalink
dev-libs/libmemcached: fix build failure against gcc-7
Browse files Browse the repository at this point in the history
Acked-by: prometheanfire
Package-Manager: Portage-2.3.5, Repoman-2.3.2
  • Loading branch information
Sergei Trofimovich committed May 17, 2017
1 parent 67d5487 commit daf83c6
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
29 changes: 29 additions & 0 deletions dev-libs/libmemcached/files/libmemcached-1.0.18-gcc7.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
gcc-7 fails the build as:
clients/memflush.cc: In function 'int main(int, char**)':
clients/memflush.cc:42:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
if (opt_servers == false)
^~~~~

opt_servers is declated as 'static char *opt_servers= NULL;'
diff --git a/clients/memflush.cc b/clients/memflush.cc
index 8bd0dbf..7641b88 100644
--- a/clients/memflush.cc
+++ b/clients/memflush.cc
@@ -39,7 +39,7 @@ int main(int argc, char *argv[])
{
options_parse(argc, argv);

- if (opt_servers == false)
+ if (!opt_servers)
{
char *temp;

@@ -48,7 +48,7 @@ int main(int argc, char *argv[])
opt_servers= strdup(temp);
}

- if (opt_servers == false)
+ if (!opt_servers)
{
std::cerr << "No Servers provided" << std::endl;
exit(EXIT_FAILURE);
3 changes: 2 additions & 1 deletion dev-libs/libmemcached/libmemcached-1.0.18-r3.ebuild
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 1999-2015 Gentoo Foundation
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=5
Expand All @@ -25,6 +25,7 @@ RDEPEND="${DEPEND}"
src_prepare() {
epatch "${FILESDIR}/debug-disable-enable-1.0.18.patch"
epatch "${FILESDIR}/continuum-1.0.18.patch"
epatch "${FILESDIR}"/${P}-gcc7.patch
sed -i '6i CFLAGS = @CFLAGS@' Makefile.am
sed -e "/_APPEND_COMPILE_FLAGS_ERROR(\[-fmudflapth\?\])/d" -i m4/ax_harden_compiler_flags.m4
eautoreconf
Expand Down

0 comments on commit daf83c6

Please sign in to comment.