Edit report at http://bugs.php.net/bug.php?id=54712&edit=1
ID: 54712 Comment by: chantry dot xavier at gmail dot com Reported by: chantry dot xavier at gmail dot com Summary: zend API should use const char * where appropriate Status: Bogus Type: Bug Package: Compile Warning Operating System: linux PHP Version: 5.3.6 Block user comment: N Private report: N New Comment: Out of curiosity, does adding const break the API ? I noticed that trunk already had lots of these fixes, so I attached an updated patch for trunk, but I could not test it. I am not even able to make php build system work on a recent debian (apparently libtool mess). Previous Comments: ------------------------------------------------------------------------ [2011-05-12 00:22:59] [email protected] BTW in trunk we already have 'const char *type_spec'. ------------------------------------------------------------------------ [2011-05-11 23:30:29] [email protected] If you can provide patches they will most likely be added. We improve this step by step but with low priority compared to other issues. As this is an already ongoing effort this bug is not needed. (also mind: even though it's trivial we can change these published apis only in trunk, not released versions) ------------------------------------------------------------------------ [2011-05-11 19:47:32] chantry dot xavier at gmail dot com Description: ------------ All zend API functions should use const char * for strings. Trying to build a C program using Zend with clang results in hundreds of warnings such as these : foo.c:4975:5: warning: passing 'const char [7]' to parameter of type 'char *' discards qualifiers PARSE_PARAMETERS("rrlszz", &zbody, &zurl, &nb_fields, &line, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ foo.c:4975:22: note: instantiated from: PARSE_PARAMETERS("rrlszz", &zbody, &zurl, &nb_fields, &line, ^~~~~~~~ /usr/include/php5/Zend/zend_API.h:238:66: note: passing argument to parameter 'type_spec' here ZEND_API int zend_parse_parameters(int num_args TSRMLS_DC, char *type_spec, ...); ^ ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=54712&edit=1
