gkralik / php7-sapnwrfc

SAP NW RFC SDK extension for PHP 7.3+ & PHP 8
https://gkralik.github.io/php7-sapnwrfc
MIT License
90 stars 35 forks source link

Error during Make #146

Closed nikhiltalati closed 1 year ago

nikhiltalati commented 1 year ago
/usr/sap/php7-sapnwrfc/sapnwrfc.c: In function ‘zim_Connection_getFunction’:
/usr/include/php/20190902/Zend/zend_types.h:701:37: warning: passing argument 2 of ‘zend_update_property_str’ from incompatible pointer type [-Wincompatible -pointer-types]
701
#define Z_OBJ(zval) (zval).value.obj ~~^~
zend_object {aka struct _zend_object }

/usr/include/php/20190902/Zend/zend_types.h:702:28: note: in expansion of macro ‘Z_OBJ’
702 | #define Z_OBJ_P(zval_p) Z_OBJ((zval_p))
| ^~~~~
/usr/sap/php7-sapnwrfc/sapnwrfc.c:586:52: note: in expansion of macro ‘Z_OBJ_P’
586 | zend_update_property_str(sapnwrfc_function_ce, Z_OBJ_P(return_value), "name", sizeof("name")-1, zend_string_copy(function_name));
| ^~~
In file included from /usr/include/php/20190902/main/php.h:38,
from /usr/sap/php7-sapnwrfc/sapnwrfc.c:14:
/usr/include/php/20190902/Zend/zend_API.h:343:71: note: expected ‘zval
’ {aka ‘struct _zval_struct ’} but argument is of type ‘zend_object ’ {aka ‘struct _zend_object ’}
343 | ZEND_API void zend_update_property_str(zend_class_entry
scope, zval object, const char name, size_t name_length, zend_string *value);
| ~~^~
/usr/sap/php7-sapnwrfc/sapnwrfc.c: In function ‘register_sapnwrfc_function_object’:
/usr/sap/php7-sapnwrfc/sapnwrfc.c:1061:141: warning: implicit declaration of function ‘ZEND_TYPE_INIT_MASK’; did you mean ‘ZEND_TYPE_IS_CLASS’? [-Wimplicit- function-declaration]
1061 | zend_declare_typed_property(sapnwrfc_function_ce, property_name_name, &property_name_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_I NIT_MASK(MAY_BE_STRING));
| ^~~

      |                                                                                                                                          ZEND_TYPE_I
S_CLASS                                                                                                                                                     
/usr/sap/php7-sapnwrfc/sapnwrfc.c:1061:161: error: ‘MAY_BE_STRING’ undeclared (first use in this function)                                                  
 1061 | d_property(sapnwrfc_function_ce, property_name_name, &property_name_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_ST
RING));                                                                                                                                                     
      |                                                                                                                                            ^~~~~~~~~

/usr/sap/php7-sapnwrfc/sapnwrfc.c:1061:161: note: each undeclared identifier is reported only once for each function it appears in
In file included from /usr/sap/nwrfcsdk/include/sapnwrfc.h:9,
from /usr/sap/php7-sapnwrfc/string_helper.h:10,
from /usr/sap/php7-sapnwrfc/sapnwrfc.c:21:
At top level:
/usr/sap/nwrfcsdk/include/sapuc.h:855:24: warning: ‘sccsidU16’ defined but not used [-Wunused-variable]
855 | static const SAP_UC* sccsidU16 = NULL;
| ^~~~~
make: *** [Makefile:192: sapnwrfc.lo] Error 1
root@afcvubtwapp:/usr/sap/php7-sapnwrfc#

davisenra commented 1 year ago

I'm having the same issue. A workaround for now is just using the previous version. Checkout into the 609b1627b3339f75fac027a89147fbd44a0ed08d commit before running make.

gkralik commented 1 year ago

I'll have a look at this.

kea commented 1 year ago

@nikhiltalati @davisenra, could you please tell me which version of PHP and OS you use?

davisenra commented 1 year ago

macOS Monterey (12.6.7) Docker Desktop (4.20.1) Docker Engine (24.0.2) PHP 7.2.34 (built: Dec 11 2020 10:56:30)

PHP is running on a Docker container.

kea commented 1 year ago

@davisenra, could you please test my PR to see if it fixes your problem?

davisenra commented 1 year ago

For sure! I'll test at work today and quote you here with my results.

davisenra commented 1 year ago

@kea worked like a charm! Building just fine on PHP 7.2, thank you for the effort :)

Captura de Tela 2023-08-18 às 10 35 24