|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patchesyaml-warnings.patch (last revision 2012-03-22 17:56 UTC by nolte at adobe dot com)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-03-22 20:36 UTC] bd808@php.net
-Assigned To:
+Assigned To: bd808
[2012-03-24 23:50 UTC] bd808@php.net
[2012-03-24 23:57 UTC] bd808@php.net
[2012-03-24 23:58 UTC] bd808@php.net
-Status: Assigned
+Status: Closed
[2012-03-24 23:58 UTC] bd808@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 22:00:01 2025 UTC |
Description: ------------ Yaml.c zeroes just a pointer's worth of the state buffer instead of the whole thing. It should use "sizeof(state)" instead of "sizeof(&state)". Emit.c is passing an char* instead of an unsigned char* (aka yaml_char_t*) and needs an explicit cast. Test script: --------------- % phpize % ./configure % make Expected result: ---------------- <no compilation warnings> Actual result: -------------- /Users/enolte/src/pecl/yaml/yaml.c:419:27: warning: argument to 'sizeof' in '__builtin___memset_chk' call is the same expression as the destination; did you mean to remove the addressof? [-Wsizeof-pointer-memaccess] memset(&state, 0, sizeof(&state)); ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~ /usr/include/secure/_string.h:77:41: note: expanded from macro 'memset' ? __builtin___memset_chk (dest, val, len, __darwin_obsz0 (dest)) \ ^ /Users/enolte/src/pecl/yaml/yaml.c:509:27: warning: argument to 'sizeof' in '__builtin___memset_chk' call is the same expression as the destination; did you mean to remove the addressof? [-Wsizeof-pointer-memaccess] memset(&state, 0, sizeof(&state)); ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~ /usr/include/secure/_string.h:77:41: note: expanded from macro 'memset' ? __builtin___memset_chk (dest, val, len, __darwin_obsz0 (dest)) \ ^ /Users/enolte/src/pecl/yaml/yaml.c:612:27: warning: argument to 'sizeof' in '__builtin___memset_chk' call is the same expression as the destination; did you mean to remove the addressof? [-Wsizeof-pointer-memaccess] memset(&state, 0, sizeof(&state)); ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~ /usr/include/secure/_string.h:77:41: note: expanded from macro 'memset' ? __builtin___memset_chk (dest, val, len, __darwin_obsz0 (dest)) \ ^ 3 warnings generated. /Users/enolte/src/pecl/yaml/emit.c:749:39: warning: passing 'char *' to parameter of type 'yaml_char_t *' (aka 'unsigned char *') converts between pointers to integer types with different sign [-Wpointer-sign] return y_write_zval(state, (*zdata), Z_STRVAL_PP(ztag) TSRMLS_CC); ^~~~~~~~~~~~~~~~~ /opt/local/include/php/Zend/zend_operators.h:422:30: note: expanded from macro 'Z_STRVAL_PP' #define Z_STRVAL_PP(zval_pp) Z_STRVAL(**zval_pp) ^ /opt/local/include/php/Zend/zend_operators.h:392:26: note: expanded from macro 'Z_STRVAL' #define Z_STRVAL(zval) (zval).value.str.val ^~~~~~~~~~~~~~~~~~~~ /Users/enolte/src/pecl/yaml/emit.c:238:51: note: passing argument to parameter 'tag' here y_emit_state_t *state, zval *data, yaml_char_t *tag TSRMLS_DC) ^ 1 warning generated.