make gearmand1.1.12 fail on mac os x with error

Bug #1318151 reported by YANG Ming
30
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Gearman
New
Undecided
Unassigned

Bug Description

libgearman/client.cc:602:66: error: comparison between pointer and integer
      ('gearman_connection_st *' and 'int')
    if (gearman_connection_create(client->universal, host, port) == false)
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~
libgearman/client.cc:617:60: error: comparison between pointer and integer
      ('gearman_connection_st *' and 'int')
  if (gearman_connection_create(universal, host, service_) == false)
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~
libgearman/client.cc:949:18: error: comparison between pointer and integer ('bool *' and 'int')
    if (is_known == false and is_running == false)
        ~~~~~~~~ ^ ~~~~~
libgearman/client.cc:949:42: error: comparison between pointer and integer ('bool *' and 'int')
    if (is_known == false and is_running == false)
                              ~~~~~~~~~~ ^ ~~~~~
4 errors generated.
make[1]: *** [libgearman/libgearman_libgearman_la-client.lo] Error 1
make: *** [all] Error 2

Tags: make osx
Revision history for this message
YANG Ming (yougmark94) wrote :
Revision history for this message
YANG Ming (yougmark94) wrote :

this is make log, including error message.

Revision history for this message
YANG Ming (yougmark94) wrote :

this is configure message during configuring.

description: updated
Revision history for this message
Dave (doc+launchpad) wrote :

Any chance of an update on this?

Thanks in advance.

Revision history for this message
Dave (doc+launchpad) wrote :

Bearing in mind that this isn't something I'd use for anything other than local development, and I have done almost no c/c++ since university so there'll be no apologies for this if it hoses your system :)

I've managed to hack this to get compilation, with the following changes:

libgearman/client.cc: ln 602:
I replaced
if (gearman_connection_create(client->universal, host, port) == false)
{
  assert(client->error_code() != GEARMAN_SUCCESS);
  return client->error_code();
}
with
gearman_connection_create(client->universal, host, port);

and similar for anywhere else the compliation error is thrown.

It seems it's just the checking syntax which is failing, whilst the connection creation itself will succeed.

Revision history for this message
Ezra Forbus (ezraforbus) wrote :

The following patch worked for me:

--- gearmand-1.1.12/libgearman/client.cc 2014-02-11 18:05:28.000000000 -0600
+++ ../gearmand-1.1.12/libgearman/client.cc 2014-07-10 13:42:13.000000000 -0500
@@ -599,7 +599,7 @@
   {
     Client* client= client_shell->impl();

- if (gearman_connection_create(client->universal, host, port) == false)
+ if (gearman_connection_create(client->universal, host, port) == NULL)
     {
       assert(client->error_code() != GEARMAN_SUCCESS);
       return client->error_code();
@@ -614,7 +614,7 @@

 gearman_return_t Client::add_server(const char *host, const char* service_)
 {
- if (gearman_connection_create(universal, host, service_) == false)
+ if (gearman_connection_create(universal, host, service_) == NULL)
   {
     assert(error_code() != GEARMAN_SUCCESS);
     return error_code();
@@ -946,7 +946,7 @@
       *denominator= do_task->impl()->denominator;
     }

- if (is_known == false and is_running == false)
+ if (! is_known and ! is_running)
     {
       if (do_task->impl()->options.is_running)
       {

NOTE: I haven't tested this extensively (other than running make test) so would advise people to use with caution.

Revision history for this message
Ezra Forbus (ezraforbus) wrote :

Here's a patch file

Revision history for this message
Filippo (dedalo) wrote :

Build fails even using MacPorts: https://trac.macports.org/ticket/47242

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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