php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #65134 PECL memcached won't compile
Submitted: 2013-06-26 15:29 UTC Modified: -
Votes:26
Avg. Score:4.3 ± 0.9
Reproduced:25 of 25 (100.0%)
Same Version:10 (40.0%)
Same OS:14 (56.0%)
From: rich06 at gmail dot com Assigned:
Status: Open Package: memcached (PECL)
PHP Version: 5.4.16 OS: OS X
Private report: No CVE-ID:
Have you experienced this issue?
Rate the importance of this bug to you:

 [2013-06-26 15:29 UTC] rich06 at gmail dot com
Description:
------------
phpize reports

Configuring for:
PHP Api Version:         20100412
Zend Module Api No:      20100525
Zend Extension Api No:   220100525

configure runs OK

make fails with 6 errors and 24 warnings...


libmemcached version is v1.0.17

memcached version is v1.4.15

Test script:
---------------
cd /usr/local/src/memcached-2.1.0
phpize
./configure
make

Expected result:
----------------
make completes succesfully

Actual result:
--------------
/usr/local/src/memcached-2.1.0/php_memcached.c:318:82: error: unknown type name 'memcached_server_instance_st'; did you mean 'memcached_server_list_st'?
static memcached_return php_memc_do_serverlist_callback(const memcached_st *ptr, memcached_server_instance_st instance, void *in_context);
                                                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                                 memcached_server_list_st
/usr/local/include/libmemcached-1.0/types.h:75:37: note: 'memcached_server_list_st' declared here
typedef struct memcached_server_st *memcached_server_list_st;
                                    ^
/usr/local/src/memcached-2.1.0/php_memcached.c:319:77: error: unknown type name 'memcached_server_instance_st'; did you mean 'memcached_server_list_st'?
static memcached_return php_memc_do_stats_callback(const memcached_st *ptr, memcached_server_instance_st instance, void *in_context);
                                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                            memcached_server_list_st
/usr/local/include/libmemcached-1.0/types.h:75:37: note: 'memcached_server_list_st' declared here
typedef struct memcached_server_st *memcached_server_list_st;
                                    ^
/usr/local/src/memcached-2.1.0/php_memcached.c:320:79: error: unknown type name 'memcached_server_instance_st'; did you mean 'memcached_server_list_st'?
static memcached_return php_memc_do_version_callback(const memcached_st *ptr, memcached_server_instance_st instance, void *in_context);
                                                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                              memcached_server_list_st
/usr/local/include/libmemcached-1.0/types.h:75:37: note: 'memcached_server_list_st' declared here
typedef struct memcached_server_st *memcached_server_list_st;
                                    ^
/usr/local/src/memcached-2.1.0/php_memcached.c:599:15: warning: assigning to 'char *' from 'const char *' discards qualifiers [-Wincompatible-pointer-types]
                payload     = memcached_result_value(&result);
                            ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/src/memcached-2.1.0/php_memcached.c:797:15: warning: assigning to 'char *' from 'const char *' discards qualifiers [-Wincompatible-pointer-types]
                payload     = memcached_result_value(&result);
                            ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/src/memcached-2.1.0/php_memcached.c:800:15: warning: assigning to 'char *' from 'const char *' discards qualifiers [-Wincompatible-pointer-types]
                res_key     = memcached_result_key_value(&result);
                            ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/src/memcached-2.1.0/php_memcached.c:1014:14: warning: assigning to 'char *' from 'const char *' discards qualifiers [-Wincompatible-pointer-types]
        payload     = memcached_result_value(&result);
                    ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/src/memcached-2.1.0/php_memcached.c:1017:14: warning: assigning to 'char *' from 'const char *' discards qualifiers [-Wincompatible-pointer-types]
        res_key     = memcached_result_key_value(&result);
                    ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/src/memcached-2.1.0/php_memcached.c:1068:15: warning: assigning to 'char *' from 'const char *' discards qualifiers [-Wincompatible-pointer-types]
                payload     = memcached_result_value(&result);
                            ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/src/memcached-2.1.0/php_memcached.c:1071:15: warning: assigning to 'char *' from 'const char *' discards qualifiers [-Wincompatible-pointer-types]
                res_key     = memcached_result_key_value(&result);
                            ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/src/memcached-2.1.0/php_memcached.c:1948:15: warning: incompatible pointer types assigning to 'memcached_server_function' (aka 'memcached_return_t (*)(const memcached_st *, const memcached_instance_st *, void *)') from 'memcached_return (const memcached_st *, memcached_server_list_st, void *)' [-Wincompatible-pointer-types]
        callbacks[0] = php_memc_do_serverlist_callback;
                     ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/src/memcached-2.1.0/php_memcached.c:1977:9: warning: incompatible pointer types assigning to 'memcached_server_st *' (aka 'struct memcached_server_st *') from 'const memcached_instance_st *' (aka 'const struct memcached_instance_st *') [-Wincompatible-pointer-types]
        server = memcached_server_by_key(m_obj->memc, server_key, server_key_len, &error);
               ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/src/memcached-2.1.0/php_memcached.c:2056:15: warning: incompatible pointer types assigning to 'memcached_server_function' (aka 'memcached_return_t (*)(const memcached_st *, const memcached_instance_st *, void *)') from 'memcached_return (const memcached_st *, memcached_server_list_st, void *)' [-Wincompatible-pointer-types]
        callbacks[0] = php_memc_do_stats_callback;
                     ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/src/memcached-2.1.0/php_memcached.c:2089:15: warning: incompatible pointer types assigning to 'memcached_server_function' (aka 'memcached_return_t (*)(const memcached_st *, const memcached_instance_st *, void *)') from 'memcached_return (const memcached_st *, memcached_server_list_st, void *)' [-Wincompatible-pointer-types]
        callbacks[0] = php_memc_do_version_callback;
                     ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/src/memcached-2.1.0/php_memcached.c:2319:13: warning: comparison of unsigned enum expression < 0 is always false [-Wtautological-compare]
                        if (flag < 0 ||
                            ~~~~ ^ ~
/usr/local/src/memcached-2.1.0/php_memcached.c:2576:82: error: unknown type name 'memcached_server_instance_st'; did you mean 'memcached_server_list_st'?
static memcached_return php_memc_do_serverlist_callback(const memcached_st *ptr, memcached_server_instance_st instance, void *in_context)
                                                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                                 memcached_server_list_st
/usr/local/include/libmemcached-1.0/types.h:75:37: note: 'memcached_server_list_st' declared here
typedef struct memcached_server_st *memcached_server_list_st;
                                    ^
/usr/local/src/memcached-2.1.0/php_memcached.c:2583:56: warning: incompatible pointer types passing 'memcached_server_list_st' (aka 'struct memcached_server_st *') to parameter of type 'const memcached_instance_st *' (aka 'const struct memcached_instance_st *') [-Wincompatible-pointer-types]
        add_assoc_string(array, "host", memcached_server_name(instance), 1);
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
/usr/include/php/Zend/zend_API.h:371:111: note: expanded from macro 'add_assoc_string'
#define add_assoc_string(__arg, __key, __str, __duplicate) add_assoc_string_ex(__arg, __key, strlen(__key)+1, __str, __duplicate)
                                                                                                              ^
/usr/local/include/libmemcached-1.0/server.h:101:65: note: passing argument to parameter 'self' here
const char *memcached_server_name(const memcached_instance_st * self);
                                                                ^
/usr/local/src/memcached-2.1.0/php_memcached.c:2583:34: warning: passing 'const char *' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types]
        add_assoc_string(array, "host", memcached_server_name(instance), 1);
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/php/Zend/zend_API.h:371:111: note: expanded from macro 'add_assoc_string'
#define add_assoc_string(__arg, __key, __str, __duplicate) add_assoc_string_ex(__arg, __key, strlen(__key)+1, __str, __duplicate)
                                                                                                              ^
/usr/include/php/Zend/zend_API.h:362:82: note: passing argument to parameter 'str' here
ZEND_API int add_assoc_string_ex(zval *arg, const char *key, uint key_len, char *str, int duplicate);
                                                                                 ^
/usr/local/src/memcached-2.1.0/php_memcached.c:2584:54: warning: incompatible pointer types passing 'memcached_server_list_st' (aka 'struct memcached_server_st *') to parameter of type 'const memcached_instance_st *' (aka 'const struct memcached_instance_st *') [-Wincompatible-pointer-types]
        add_assoc_long(array, "port", memcached_server_port(instance));
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
/usr/include/php/Zend/zend_API.h:366:92: note: expanded from macro 'add_assoc_long'
#define add_assoc_long(__arg, __key, __n) add_assoc_long_ex(__arg, __key, strlen(__key)+1, __n)
                                                                                           ^
/usr/local/include/libmemcached-1.0/server.h:104:63: note: passing argument to parameter 'self' here
in_port_t memcached_server_port(const memcached_instance_st * self);
                                                              ^
/usr/local/src/memcached-2.1.0/php_memcached.c:2593:77: error: unknown type name 'memcached_server_instance_st'; did you mean 'memcached_server_list_st'?
static memcached_return php_memc_do_stats_callback(const memcached_st *ptr, memcached_server_instance_st instance, void *in_context)
                                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                            memcached_server_list_st
/usr/local/include/libmemcached-1.0/types.h:75:37: note: 'memcached_server_list_st' declared here
typedef struct memcached_server_st *memcached_server_list_st;
                                    ^
/usr/local/src/memcached-2.1.0/php_memcached.c:2599:71: warning: incompatible pointer types passing 'memcached_server_list_st' (aka 'struct memcached_server_st *') to parameter of type 'const memcached_instance_st *' (aka 'const struct memcached_instance_st *') [-Wincompatible-pointer-types]
        hostport_len = spprintf(&hostport, 0, "%s:%d", memcached_server_name(instance), memcached_server_port(instance));
                                                                             ^~~~~~~~
/usr/local/include/libmemcached-1.0/server.h:101:65: note: passing argument to parameter 'self' here
const char *memcached_server_name(const memcached_instance_st * self);
                                                                ^
/usr/local/src/memcached-2.1.0/php_memcached.c:2599:104: warning: incompatible pointer types passing 'memcached_server_list_st' (aka 'struct memcached_server_st *') to parameter of type 'const memcached_instance_st *' (aka 'const struct memcached_instance_st *') [-Wincompatible-pointer-types]
        hostport_len = spprintf(&hostport, 0, "%s:%d", memcached_server_name(instance), memcached_server_port(instance));
                                                                                                              ^~~~~~~~
/usr/local/include/libmemcached-1.0/server.h:104:63: note: passing argument to parameter 'self' here
in_port_t memcached_server_port(const memcached_instance_st * self);
                                                              ^
/usr/local/src/memcached-2.1.0/php_memcached.c:2637:79: error: unknown type name 'memcached_server_instance_st'; did you mean 'memcached_server_list_st'?
static memcached_return php_memc_do_version_callback(const memcached_st *ptr, memcached_server_instance_st instance, void *in_context)
                                                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                              memcached_server_list_st
/usr/local/include/libmemcached-1.0/types.h:75:37: note: 'memcached_server_list_st' declared here
typedef struct memcached_server_st *memcached_server_list_st;
                                    ^
/usr/local/src/memcached-2.1.0/php_memcached.c:2644:71: warning: incompatible pointer types passing 'memcached_server_list_st' (aka 'struct memcached_server_st *') to parameter of type 'const memcached_instance_st *' (aka 'const struct memcached_instance_st *') [-Wincompatible-pointer-types]
        hostport_len = spprintf(&hostport, 0, "%s:%d", memcached_server_name(instance), memcached_server_port(instance));
                                                                             ^~~~~~~~
/usr/local/include/libmemcached-1.0/server.h:101:65: note: passing argument to parameter 'self' here
const char *memcached_server_name(const memcached_instance_st * self);
                                                                ^
/usr/local/src/memcached-2.1.0/php_memcached.c:2644:104: warning: incompatible pointer types passing 'memcached_server_list_st' (aka 'struct memcached_server_st *') to parameter of type 'const memcached_instance_st *' (aka 'const struct memcached_instance_st *') [-Wincompatible-pointer-types]
        hostport_len = spprintf(&hostport, 0, "%s:%d", memcached_server_name(instance), memcached_server_port(instance));
                                                                                                              ^~~~~~~~
/usr/local/include/libmemcached-1.0/server.h:104:63: note: passing argument to parameter 'self' here
in_port_t memcached_server_port(const memcached_instance_st * self);
                                                              ^
/usr/local/src/memcached-2.1.0/php_memcached.c:2646:36: warning: incompatible pointer types passing 'memcached_server_list_st' (aka 'struct memcached_server_st *') to parameter of type 'const memcached_instance_st *' (aka 'const struct memcached_instance_st *') [-Wincompatible-pointer-types]
                                memcached_server_major_version(instance),
                                                               ^~~~~~~~
/usr/local/include/libmemcached-1.0/server.h:113:70: note: passing argument to parameter 'ptr' here
uint8_t memcached_server_major_version(const memcached_instance_st * ptr);
                                                                     ^
/usr/local/src/memcached-2.1.0/php_memcached.c:2647:36: warning: incompatible pointer types passing 'memcached_server_list_st' (aka 'struct memcached_server_st *') to parameter of type 'const memcached_instance_st *' (aka 'const struct memcached_instance_st *') [-Wincompatible-pointer-types]
                                memcached_server_minor_version(instance),
                                                               ^~~~~~~~
/usr/local/include/libmemcached-1.0/server.h:116:70: note: passing argument to parameter 'ptr' here
uint8_t memcached_server_minor_version(const memcached_instance_st * ptr);
                                                                     ^
/usr/local/src/memcached-2.1.0/php_memcached.c:2648:36: warning: incompatible pointer types passing 'memcached_server_list_st' (aka 'struct memcached_server_st *') to parameter of type 'const memcached_instance_st *' (aka 'const struct memcached_instance_st *') [-Wincompatible-pointer-types]
                                memcached_server_micro_version(instance));
                                                               ^~~~~~~~
/usr/local/include/libmemcached-1.0/server.h:119:70: note: passing argument to parameter 'ptr' here
uint8_t memcached_server_micro_version(const memcached_instance_st * ptr);
                                                                     ^
/usr/local/src/memcached-2.1.0/php_memcached.c:3191:14: warning: assigning to 'char *' from 'const char *' discards qualifiers [-Wincompatible-pointer-types]
        payload     = memcached_result_value(result);
                    ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/src/memcached-2.1.0/php_memcached.c:3194:14: warning: assigning to 'char *' from 'const char *' discards qualifiers [-Wincompatible-pointer-types]
        res_key     = memcached_result_key_value(result);
                    ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
24 warnings and 6 errors generated.
make: *** [php_memcached.lo] Error 1

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-07-12 23:24 UTC] don at smugmug dot com
FWIW, this single line change from the bug on github worked for me:  
https://github.com/php-memcached-dev/php-memcached/issues/69#issuecomment-17051990
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Sun Apr 20 13:01:59 2014 UTC