|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-01-21 04:56 UTC] rasmus@php.net
[2012-01-21 04:56 UTC] rasmus@php.net
-Status: Open
+Status: Feedback
[2012-01-23 10:01 UTC] uw@php.net
[2012-01-23 10:02 UTC] uw@php.net
-Status: Feedback
+Status: Closed
-Assigned To:
+Assigned To: uw
[2012-01-23 10:02 UTC] uw@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 16:00:02 2025 UTC |
Description: ------------ APC: pecl/svn - trunk (Revision 322504) PHP: 5_4, svn - PHP 5.4.0RC7-dev Static build: ./configure --enable-apc --enable-debug --enable-maintainer-zts GCC: gcc (SUSE Linux) 4.6.2 GCC bails a bit on char*/const char* differences in apc_string.c: nst’ qualifier from pointer target type [enabled by default] /usr/include/string.h:44:14: note: expected ‘void * __restrict__’ but argument is of type ‘const char *’ /home/nixnutz/php-src/branches/PHP_5_4/ext/apc/apc_string.c:126:5: warning: return discards ‘const’ qualifier from pointer target type [enabled by default] /home/nixnutz/php-src/branches/PHP_5_4/ext/apc/apc_string.c: In function ‘apc_copy_internal_strings’: /home/nixnutz/php-src/branches/PHP_5_4/ext/apc/apc_string.c:136:13: warning: passing argument 1 of ‘apc_new_interned_string’ discards ‘const’ qualifier from pointer target type [enabled by default] /home/nixnutz/php-src/branches/PHP_5_4/ext/apc/apc_string.c:68:7: note: expected ‘char *’ but argument is of type ‘const char *’ /home/nixnutz/php-src/branches/PHP_5_4/ext/apc/apc_string.c:146:13: warning: passing argument 1 of ‘apc_new_interned_string’ discards ‘const’ qualifier from pointer target type [enabled by default] /home/nixnutz/php-src/branches/PHP_5_4/ext/apc/apc_string.c:68:7: note: expected ‘char *’ but argument is of type ‘const char *’ /home/nixnutz/php-src/branches/PHP_5_4/ext/apc/apc_string.c:150:4: warning: passing argument 1 of ‘apc_new_interned_string’ discards ‘const’ qualifier from pointer target type [enabled by default] /home/nixnutz/php-src/branches/PHP_5_4/ext/apc/apc_string.c:68:7: note: expected ‘char *’ but argument is of type ‘const char *’ /home/nixnutz/php-src/branches/PHP_5_4/ext/apc/apc_string.c:158:17: warning: passing argument 1 of ‘apc_new_interned_string’ discards ‘const’ qualifier from pointer target type [enabled by default] /home/nixnutz/php-src/branches/PHP_5_4/ext/apc/apc_string.c:68:7: note: expected ‘char *’ but argument is of type ‘const char *’ /home/nixnutz/php-src/branches/PHP_5_4/ext/apc/apc_string.c:162:17: warning: passing argument 1 of ‘apc_new_interned_string’ discards ‘const’ qualifier from pointer target type [enabled by default] /home/nixnutz/php-src/branches/PHP_5_4/ext/apc/apc_string.c:68:7: note: expected ‘char *’ but argument is of type ‘const char *’ /home/nixnutz/php-src/branches/PHP_5_4/ext/apc/apc_string.c:171:17: warning: passing argument 1 of ‘apc_new_interned_string’ discards ‘const’ qualifier from pointer target type [enabled by default] /home/nixnutz/php-src/branches/PHP_5_4/ext/apc/apc_string.c:68:7: note: expected ‘char *’ but argument is of type ‘const char *’ /home/nixnutz/php-src/branches/PHP_5_4/ext/apc/apc_string.c:179:17: warning: passing argument 1 of ‘apc_new_interned_string’ discards ‘const’ qualifier from pointer target type [enabled by default] /home/nixnutz/php-src/branches/PHP_5_4/ext/apc/apc_string.c:68:7: note: expected ‘char *’ but argument is of type ‘const char *’ /home/nixnutz/php-src/branches/PHP_5_4/ext/apc/apc_string.c:190:13: warning: passing argument 1 of ‘apc_new_interned_string’ discards ‘const’ qualifier from pointer target type [enabled by default] apc_new_interned_string() seems to have been created to copy arKey members of a Bucket. arKey is defined as a const char* in PHP 5.4: typedef struct bucket { ulong h; /* Used for numeric indexing */ uint nKeyLength; void *pData; void *pDataPtr; struct bucket *pListNext; struct bucket *pListLast; struct bucket *pNext; struct bucket *pLast; const char *arKey; } Bucket; In PHP 5.3 there is no const qualifier for arKey: 53 54 typedef struct bucket { 55 ulong h; /* Used for numeric indexing */ 56 uint nKeyLength; 57 void *pData; 58 void *pDataPtr; 59 struct bucket *pListNext; 60 struct bucket *pListLast; 61 struct bucket *pNext; 62 struct bucket *pLast; 63 char arKey[1]; /* Must be last element */ 64 } Bucket; Please, update APC to avoid the compiler warnings. For example, change the apc_new_interned_string() signature in 5.4 to: const char *apc_new_interned_string(const char *arKey, int nKeyLength TSRMLS_DC) Test script: --------------- ./configure --enable-apc --enable-debug --enable-maintainer-zts Check out for APC related compiler warnings