Making libmemcached-1.0.18, ISO C++ forbids comparison between pointer and integer [-fpermissive]
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
libmemcached |
New
|
Undecided
|
Unassigned |
Bug Description
I get the following error when attempting to build. It happens whether I do --enable-memaslap or not. Is there any other way to get memaslap?
clients/
clients/
42 | if (opt_servers == false)
| ^~~~~
clients/
51 | if (opt_servers == false)
| ^~~~~
make[1]: *** [Makefile:5832: clients/memflush.o] Error 1
make[1]: Leaving directory '/home/
make: *** [Makefile:9973: install] Error 2
you have to replace false by NULL to fix the syntax to avoid those errors with newer compilers.
use a patch file like this:
# avoid comparison of pointer with integer memflush. cc.orig 2014-02-09 12:52:42.000000000 +0100 parse(argc, argv);
# error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
#
--- clients/
+++ clients/memflush.cc 2022-06-03 10:06:40.989938212 +0200
@@ -39,7 +39,7 @@
{
options_
- if (opt_servers == false)
+ if (opt_servers == NULL)
{
char *temp;
@@ -48,7 +48,7 @@
opt_servers= strdup(temp);
}
- if (opt_servers == false)
exit(EXIT_ FAILURE) ;
+ if (opt_servers == NULL)
{
std::cerr << "No Servers provided" << std::endl;