想實現個簡單的模板引擎擴充,最近在調試中.但是將擴充編譯成so之後卻發生了下面的狀況:
運行make的時候出現以下warning:
/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]
相應程式碼片段如下:
//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; }
起初我認為是宏的定義有問題,但是當我將Z_OBJ_P替換成應該使用的zend_object_get_address時,同樣的warning會出現.我在引入標頭檔時只是將php.h引入.不知是否有同樣經曆的前輩解決過這樣的問題,望指教!謝謝!
回複內容:
想實現個簡單的模板引擎擴充,最近在調試中.但是將擴充編譯成so之後卻發生了下面的狀況:
運行make的時候出現以下warning:
/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]
相應程式碼片段如下:
//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; }
起初我認為是宏的定義有問題,但是當我將Z_OBJ_P替換成應該使用的zend_object_get_address時,同樣的warning會出現.我在引入標頭檔時只是將php.h引入.不知是否有同樣經曆的前輩解決過這樣的問題,望指教!謝謝!