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!