Z_obj_p warning issues encountered in writing PHP extensions

Source: Internet
Author: User
Want to implement a simple template engine extension, recently in debugging. But after compiling the extension into so, the following condition occurs:

The following warning appear when you run make:

/home/x64-debian-fxy/php5-5.4.4/ext/template_parser/template_parser.c: In function 'zif_template_parser_pause':/home/x64-debian-fxy/php5-5.4.4/ext/template_parser/template_parser.c:114:21: warning: assignment makes pointer from integer without a cast [enabled by default]

The corresponding code snippet is as follows:

//Fetch real object in order to fetch it's scope.    if(Z_TYPE_P(object_container) == IS_OBJECT){        //问题在下行.        real_object = Z_OBJ_P(object_container);    } else {        real_object = NULL;    }

At first I thought there was a problem with the definition of the macro, but the same warning will appear when I replace it with the one that Z_OBJ_P should be used. zend_object_get_address I'll just introduce it when I introduce a header file php.h . I do not know whether the same experience of the predecessors to solve such problems, hope advice!

Reply content:

Want to implement a simple template engine extension, recently in debugging. But after compiling the extension into so, the following condition occurs:

The following warning appear when you run make:

/home/x64-debian-fxy/php5-5.4.4/ext/template_parser/template_parser.c: In function 'zif_template_parser_pause':/home/x64-debian-fxy/php5-5.4.4/ext/template_parser/template_parser.c:114:21: warning: assignment makes pointer from integer without a cast [enabled by default]

The corresponding code snippet is as follows:

//Fetch real object in order to fetch it's scope.    if(Z_TYPE_P(object_container) == IS_OBJECT){        //问题在下行.        real_object = Z_OBJ_P(object_container);    } else {        real_object = NULL;    }

At first I thought there was a problem with the definition of the macro, but the same warning will appear when I replace it with the one that Z_OBJ_P should be used. zend_object_get_address I'll just introduce it when I introduce a header file php.h . I do not know whether the same experience of the predecessors to solve such problems, hope advice!

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.