php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64701 memcached 2.1.0 compilation error with libmemcached 1.0.17
Submitted: 2013-04-23 22:39 UTC Modified: 2013-04-23 22:42 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: root at jusme dot org Assigned: andrei (profile)
Status: Closed Package: memcached (PECL)
PHP Version: 5.3.24 OS: Ubuntu 9.10
Private report: No CVE-ID: None
 [2013-04-23 22:39 UTC] root at jusme dot org
Description:
------------
Trying to compile PECL memcached 2.1.0 against libmemcached 1.0.17 (and possibly other 1.x versions) and I get the following compile errors:

/tmp/pear/temp/memcached/php_memcached.c:314: error: expected declaration specifiers or ‘...’ before ‘memcached_server_instance_st’
/tmp/pear/temp/memcached/php_memcached.c:315: error: expected declaration specifiers or ‘...’ before ‘memcached_server_instance_st’
/tmp/pear/temp/memcached/php_memcached.c:316: error: expected declaration specifiers or ‘...’ before ‘memcached_server_instance_st’
/tmp/pear/temp/memcached/php_memcached.c: In function ‘php_memc_get_impl’:
/tmp/pear/temp/memcached/php_memcached.c:595: warning: assignment discards qualifiers from pointer target type
/tmp/pear/temp/memcached/php_memcached.c: In function ‘php_memc_getMulti_impl’:
/tmp/pear/temp/memcached/php_memcached.c:793: warning: assignment discards qualifiers from pointer target type
/tmp/pear/temp/memcached/php_memcached.c:796: warning: assignment discards qualifiers from pointer target type
/tmp/pear/temp/memcached/php_memcached.c: In function ‘zim_Memcached_fetch’:
/tmp/pear/temp/memcached/php_memcached.c:1010: warning: assignment discards qualifiers from pointer target type
/tmp/pear/temp/memcached/php_memcached.c:1013: warning: assignment discards qualifiers from pointer target type
/tmp/pear/temp/memcached/php_memcached.c: In function ‘zim_Memcached_fetchAll’:
/tmp/pear/temp/memcached/php_memcached.c:1064: warning: assignment discards qualifiers from pointer target type
/tmp/pear/temp/memcached/php_memcached.c:1067: warning: assignment discards qualifiers from pointer target type
/tmp/pear/temp/memcached/php_memcached.c: In function ‘zim_Memcached_getServerList’:
/tmp/pear/temp/memcached/php_memcached.c:1944: warning: assignment from incompatible pointer type
/tmp/pear/temp/memcached/php_memcached.c: In function ‘zim_Memcached_getServerByKey’:
/tmp/pear/temp/memcached/php_memcached.c:1973: warning: assignment from incompatible pointer type
/tmp/pear/temp/memcached/php_memcached.c: In function ‘zim_Memcached_getStats’:
/tmp/pear/temp/memcached/php_memcached.c:2058: warning: assignment from incompatible pointer type
/tmp/pear/temp/memcached/php_memcached.c: In function ‘zim_Memcached_getVersion’:
/tmp/pear/temp/memcached/php_memcached.c:2091: warning: assignment from incompatible pointer type
/tmp/pear/temp/memcached/php_memcached.c: At top level:
/tmp/pear/temp/memcached/php_memcached.c:2578: error: expected declaration specifiers or ‘...’ before ‘memcached_server_instance_st’
/tmp/pear/temp/memcached/php_memcached.c: In function ‘php_memc_do_serverlist_callback’:
/tmp/pear/temp/memcached/php_memcached.c:2585: error: ‘instance’ undeclared (first use in this function)
/tmp/pear/temp/memcached/php_memcached.c:2585: error: (Each undeclared identifier is reported only once
/tmp/pear/temp/memcached/php_memcached.c:2585: error: for each function it appears in.)
/tmp/pear/temp/memcached/php_memcached.c: At top level:
/tmp/pear/temp/memcached/php_memcached.c:2592: error: expected declaration specifiers or ‘...’ before ‘memcached_server_instance_st’
/tmp/pear/temp/memcached/php_memcached.c: In function ‘php_memc_do_stats_callback’:
/tmp/pear/temp/memcached/php_memcached.c:2598: error: ‘instance’ undeclared (first use in this function)
/tmp/pear/temp/memcached/php_memcached.c: At top level:
/tmp/pear/temp/memcached/php_memcached.c:2636: error: expected declaration specifiers or ‘...’ before ‘memcached_server_instance_st’
/tmp/pear/temp/memcached/php_memcached.c: In function ‘php_memc_do_version_callback’:
/tmp/pear/temp/memcached/php_memcached.c:2643: error: ‘instance’ undeclared (first use in this function)
/tmp/pear/temp/memcached/php_memcached.c: In function ‘php_memc_do_result_callback’:
/tmp/pear/temp/memcached/php_memcached.c:3189: warning: assignment discards qualifiers from pointer target type
/tmp/pear/temp/memcached/php_memcached.c:3192: warning: assignment discards qualifiers from pointer target type

The errors are due to the fact that the following define from libmemcached 0.x is no longer in libmemcached 1.x. The typedef was kludged into PECL memcached 2.0.1 in php_libmemcached_compat.h:

typedef const struct memcached_server_st *memcached_server_instance_st;


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-04-23 22:41 UTC] root at jusme dot org
For libmemcached 0.x of the typedef was in types.h and is no longer present in libmemcached 1.0.17.
 [2013-04-23 22:42 UTC] andrei@php.net
Please open an issue here instead:

https://github.com/php-memcached-dev/php-memcached/issues
 [2013-04-23 22:42 UTC] andrei@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: andrei
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Dec 02 04:01:24 2020 UTC