Making libmemcached-1.0.18, ISO C++ forbids comparison between pointer and integer [-fpermissive]

Bug #1930458 reported by Jackson Dagger
8
This bug affects 1 person
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/memflush.cc: In function ‘int main(int, char**)’:
clients/memflush.cc:42:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   42 | if (opt_servers == false)
      | ^~~~~
clients/memflush.cc:51:24: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   51 | if (opt_servers == false)
      | ^~~~~
make[1]: *** [Makefile:5832: clients/memflush.o] Error 1
make[1]: Leaving directory '/home/jackson/Documents/Systopia/libmemcached-1.0.18'
make: *** [Makefile:9973: install] Error 2

Revision history for this message
Jackson Dagger (jacksondagger) wrote :
Revision history for this message
hgy (hpgysin) wrote :

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
# error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
#
--- clients/memflush.cc.orig 2014-02-09 12:52:42.000000000 +0100
+++ clients/memflush.cc 2022-06-03 10:06:40.989938212 +0200
@@ -39,7 +39,7 @@
 {
   options_parse(argc, argv);

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

@@ -48,7 +48,7 @@
       opt_servers= strdup(temp);
     }

- if (opt_servers == false)
+ if (opt_servers == NULL)
     {
       std::cerr << "No Servers provided" << std::endl;
       exit(EXIT_FAILURE);

Revision history for this message
hgy (hpgysin) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.