Bug #54712 [NEW]: zend API should use const char * where appropriate

From: Date: Wed, 11 May 2011 17:47:33 +0000
Subject: Bug #54712 [NEW]: zend API should use const char * where appropriate
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-160684@lists.php.net to get a copy of this message
From:             
Operating system: linux
PHP version:      5.3.6
Package:          Compile Warning
Bug Type:         Bug
Bug description:zend API should use const char * where appropriate

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 bug report at http://bugs.php.net/bug.php?id=54712&edit=1
-- 
Try a snapshot (PHP 5.2):            http://bugs.php.net/fix.php?id=54712&r=trysnapshot52
Try a snapshot (PHP 5.3):            http://bugs.php.net/fix.php?id=54712&r=trysnapshot53
Try a snapshot (trunk):              http://bugs.php.net/fix.php?id=54712&r=trysnapshottrunk
Fixed in SVN:                        http://bugs.php.net/fix.php?id=54712&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=54712&r=needdocs
Fixed in release:                    http://bugs.php.net/fix.php?id=54712&r=alreadyfixed
Need backtrace:                      http://bugs.php.net/fix.php?id=54712&r=needtrace
Need Reproduce Script:               http://bugs.php.net/fix.php?id=54712&r=needscript
Try newer version:                   http://bugs.php.net/fix.php?id=54712&r=oldversion
Not developer issue:                 http://bugs.php.net/fix.php?id=54712&r=support
Expected behavior:                   http://bugs.php.net/fix.php?id=54712&r=notwrong
Not enough info:                     http://bugs.php.net/fix.php?id=54712&r=notenoughinfo
Submitted twice:                     http://bugs.php.net/fix.php?id=54712&r=submittedtwice
register_globals:                    http://bugs.php.net/fix.php?id=54712&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=54712&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=54712&r=dst
IIS Stability:                       http://bugs.php.net/fix.php?id=54712&r=isapi
Install GNU Sed:                     http://bugs.php.net/fix.php?id=54712&r=gnused
Floating point limitations:          http://bugs.php.net/fix.php?id=54712&r=float
No Zend Extensions:                  http://bugs.php.net/fix.php?id=54712&r=nozend
MySQL Configuration Error:           http://bugs.php.net/fix.php?id=54712&r=mysqlcfg



Thread (4 messages)

« previous php.bugs (#160684) next »