码迷,mamicode.com
首页 > Web开发 > 详细

Redhat编译php-5.2.9出现error dereferencing pointer to incomplete type

时间:2015-11-24 06:28:07      阅读:1766      评论:0      收藏:0      [点我收藏+]

标签:error dereferencing pointer to incomplete type

错误1

/usr/src/php-5.2.9/ext/dom/node.c:In function ‘dom_canonicalization‘:

/usr/src/php-5.2.9/ext/dom/node.c:1950:21: error: dereferencingpointer to incomplete type

    ret = buf->buffer->use;

                                 ^

Infile included from /usr/src/php-5.2.9/main/php.h:38:0,

                 from/usr/src/php-5.2.9/ext/dom/node.c:26:

/usr/src/php-5.2.9/ext/dom/node.c:1952:40: error:dereferencing pointer to incomplete type

     RETVAL_STRINGL((char *)buf->buffer->content, ret, 1);

                                        ^

/usr/src/php-5.2.9/Zend/zend_API.h:472:14:note: in definition of macro ‘ZVAL_STRINGL‘

   char *__s=(s); int __l=l;  \

              ^

/usr/src/php-5.2.9/ext/dom/node.c:1952:5:note: in expansion of macro ‘RETVAL_STRINGL‘

     RETVAL_STRINGL((char *)buf->buffer->content, ret, 1);

make:*** [ext/dom/node.lo] 错误1

[root@localhostphp-5.2.9]#

 

错误2

/usr/src/php-5.2.9/ext/dom/documenttype.c:In function ‘dom_documenttype_internal_subset_read‘:

/usr/src/php-5.2.9/ext/dom/documenttype.c:219:42: error:dereferencing pointer to incomplete type

    strintsubset =xmlStrndup(buff->buffer->content, buff->buffer->use);

                                 ^

/usr/src/php-5.2.9/ext/dom/documenttype.c:219:65: error:dereferencing pointer to incomplete type

    strintsubset =xmlStrndup(buff->buffer->content, buff->buffer->use);

                                ^

make:*** [ext/dom/documenttype.lo] 错误 1

[root@localhostphp-5.2.9]#

 

解决办法:

  1. 下载https://mail.gnome.org/archives/xml/2012-August/txtbgxGXAvz4N.txt补丁程序

  2. 编辑/usr/src/php-5.2.9/ext/dom/node.c文件,将源代码段替换为对应的补丁代码段(表紫色部分)

---ext/dom/node.c  2012-08-06 17:49:48.826716692+0800

+++ext/dom/node.c      2012-08-0617:52:47.633484660 +0800

@@-1895,9 +1895,17 @@ static void dom_canonicalization(INTERNA

         RETVAL_FALSE;

     } else {

             if (mode == 0) {

#ifdef LIBXML2_NEW_BUFFER

            ret =xmlOutputBufferGetSize(buf);

#else

                    ret = buf->buffer->use;

#endif

                    if (ret > 0) {

#ifdef LIBXML2_NEW_BUFFER

               RETVAL_STRINGL((char *) xmlOutputBufferGetContent(buf), ret, 1);

+#else

                           RETVAL_STRINGL((char *) buf->buffer->content,ret, 1);

#endif

                    } else {

                           RETVAL_EMPTY_STRING();

                    }

3.同理编辑/usr/src/php-5.2.9/ext/dom/documenttype.c文件,将源代码段替换为对应的补丁代码段(表紫色部分)

---ext/dom/documenttype.c   2012-08-0618:02:16.019640870 +0800

+++ext/dom/documenttype.c       2012-08-06 18:06:16.612228905+0800

@@-205,7 +205,13 @@ int dom_documenttype_internal_subset_rea

             if (buff != NULL) {

                    xmlNodeDumpOutput (buff, NULL, (xmlNodePtr)intsubset, 0, 0, NULL);

                    xmlOutputBufferFlush(buff);

 

#ifdef LIBXML2_NEW_BUFFER

                     ZVAL_STRINGL(*retval,xmlOutputBufferGetContent(buff),

                                  xmlOutputBufferGetSize(buff), 1);

#else

                    ZVAL_STRINGL(*retval, buff->buffer->content,buff->buffer->use, 1);

#endif

                    (void)xmlOutputBufferClose(buff);

                    return SUCCESS;

             }


本文出自 “DOSOM” 博客,谢绝转载!

Redhat编译php-5.2.9出现error dereferencing pointer to incomplete type

标签:error dereferencing pointer to incomplete type

原文地址:http://8656934.blog.51cto.com/8646934/1716131

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!