PHP 4.0 Bug #6959: can't compile when using --enable-sockets

From: Date: Sat, 30 Sep 2000 10:24:01 +0000
Subject: PHP 4.0 Bug #6959: can't compile when using --enable-sockets
Groups: php.dev 
Request: Send a blank email to php-dev+get-33910@lists.php.net to get a copy of this message
From: long@kestrel.cc.ukans.edu Operating system: Tru64 5.0 PHP version: 4.0.2 PHP Bug Type: Compile Failure Bug description: can't compile when using --enable-sockets env CFLAGS="-ifo -O2" CC=cc ./configure --enable-dba=shared --enable-dbase --with-dbm --enable-filepro --with-msql --with-ndbm --with-oci8 --with-oracle --with-gd=shared --with-ttf --enable-bcmath --enable-discard-path --enable-sysvmem --enable-sysvshm --with-java --enable-ftp --enable-sockets --enable-wddx was how I configured it. Then when I compile I get the following warnings/errors when it gets to compiling the sockets extension: Making all in sockets /bin/sh /home/long/src/php-4.0.2/libtool --silent --mode=compile cc -I. -I/home/long/src/php-4.0.2/ext/sockets -I/home/long/src/php-4.0.2 -I/home/long/src/php-4.0.2/main -I/home/long/src/php-4.0.2/Zend -I/home/long/src/php-4.0.2 -I/usr/local/include -I/usr/local/Hughes/include -I/home/long/src/php-4.0.2/ext/mysql/libmysql -I/home/oracle/u01/app/oracle/product/8.0.5/rdbms/demo -I/home/oracle/u01/app/oracle/product/8.0.5/network/public -I/home/oracle/u01/app/oracle/product/8.0.5/plsql/public -I/home/long/src/php-4.0.2/ext/xml/expat/xmltok -I/home/long/src/php-4.0.2/ext/xml/expat/xmlparse -DXML_BYTE_ORDER=12 -ifo -O2 -c sockets.c cc: Warning: sockets.c, line 638: In this statement, the referenced type of the pointer value "&sa" is "struct sockaddr_in", which is not compatible with "struct sockaddr". (ptrmismatch) ret = getsockname(Z_LVAL_PP(fd), &sa, &salen); -----------------------------------------^ cc: Warning: sockets.c, line 734: In this statement, the referenced type of the pointer value "&sa" is "struct sockaddr_in", which is not compatible with "struct sockaddr". (ptrmismatch) ret = getpeername(Z_LVAL_PP(fd), &sa, &salen); -----------------------------------------^ cc: Warning: sockets.c, line 877: In this statement, the referenced type of the pointer value "&sa" is "struct sockaddr", which is not compatible with "struct sockaddr_in". (ptrmismatch) sin = &sa; ------------------------^ cc: Warning: sockets.c, line 902: In this statement, the referenced type of the pointer value "&sa" is "struct sockaddr", which is not compatible with "struct sockaddr_un". (ptrmismatch) sun = &sa; ------------------------^ cc: Warning: sockets.c, line 929: In this statement, "hstrerror(...)" of type "int", is being converted to "pointer to const char". (cvtdiftypes) buf = hstrerror(-(Z_LVAL_PP(error))); ----------------^ cc: Warning: sockets.c, line 966: In this statement, the referenced type of the pointer value "&length" is "unsigned long", which is not compatible with "int". (ptrmismatch) ret = getsockname(Z_LVAL_PP(arg0), &sock_type, &length); -------------------------------------------------------^ cc: Warning: sockets.c, line 973: In this statement, the referenced type of the pointer value "&sa" is "struct sockaddr_un", which is not compatible with "const struct sockaddr". (ptrmismatch) ret = bind(Z_LVAL_PP(arg0), &sa, SUN_LEN(&sa)); --------------------------------------------^ cc: Warning: sockets.c, line 996: In this statement, the referenced type of the pointer value "&sa" is "struct sockaddr_in", which is not compatible with "const struct sockaddr". (ptrmismatch) ret = bind(Z_LVAL_PP(arg0), &sa, sizeof(sa)); --------------------------------------------^ cc: Warning: sockets.c, line 1325: In this statement, the referenced type of the pointer value "&salen" is "unsigned long", which is not compatible with "int". (ptrmismatch) ret = getsockname(Z_LVAL_PP(fd), &sa, &salen); ----------------------------------------------^ cc: Warning: sockets.c, line 1345: In this statement, the referenced type of the pointer value "(socklen_t ...)&sun_length" is "unsigned long", which is not compatible with "int". (ptrmismatch) (struct sockaddr *)&sun, (socklen_t *) & sun_length); ------------------------------------------------------------------------^ cc: Warning: sockets.c, line 1384: In this statement, the referenced type of the pointer value "(socklen_t ...)&sin_length" is "unsigned long", which is not compatible with "int". (ptrmismatch) (struct sockaddr *)&sin, (socklen_t *) & sin_length); ------------------------------------------------------------------------^ cc: Warning: sockets.c, line 1454: In this statement, the referenced type of the pointer value "&salen" is "unsigned long", which is not compatible with "int". (ptrmismatch) ret = getsockname(Z_LVAL_PP(fd), &sa, &salen); ----------------------------------------------^ cc: Warning: sockets.c, line 1473: In this statement, the referenced type of the pointer value "&sun" is "struct sockaddr_un", which is not compatible with "const struct sockaddr". (ptrmismatch) Z_LVAL_PP(flags), &sun, SUN_LEN(&sun)); ---------------------------------------------------------------^ cc: Warning: sockets.c, line 1503: In this statement, the referenced type of the pointer value "&sin" is "struct sockaddr_in", which is not compatible with "const struct sockaddr". (ptrmismatch) Z_LVAL_PP(flags), &sin, sizeof(sin)); ---------------------------------------------------------------^ cc: Warning: sockets.c, line 1556: In this statement, the referenced type of the pointer value "&salen" is "unsigned long", which is not compatible with "int". (ptrmismatch) ret = getsockname(Z_LVAL_PP(fd), &sa, &salen); ----------------------------------------------^ cc: Warning: sockets.c, line 1576: In this statement, the referenced type of the pointer value "sin" is "struct sockaddr_in", which is not compatible with "char". (ptrmismatch) hdr.msg_name = sin; --------------------------------^ cc: Error: sockets.c, line 1582: In this statement, "msg_control" is not a member of "hdr". (needmember) hdr.msg_control = ctl_buf; ----------------------------------------^ cc: Error: sockets.c, line 1583: In this statement, "msg_controllen" is not a member of "hdr". (needmember) hdr.msg_controllen = Z_LVAL_PP(controllen); ----------------------------------------^ cc: Error: sockets.c, line 1585: In this statement, "msg_control" is not a member of "hdr". (needmember) hdr.msg_control = NULL; ----------------------------------------^ cc: Error: sockets.c, line 1586: In this statement, "msg_controllen" is not a member of "hdr". (needmember) hdr.msg_controllen = 0; ----------------------------------------^ cc: Error: sockets.c, line 1589: In this statement, "msg_flags" is not a member of "hdr". (needmember) hdr.msg_flags = 0; --------------------------------^ cc: Error: sockets.c, line 1595: In the initializer for mhdr, "msg_control" is not a member of "hdr". (needmember) struct cmsghdr *mhdr = (struct cmsghdr *) hdr.msg_control; ----------------------------------------------------------------------------------^ cc: Warning: sockets.c, line 1604: In this statement, the referenced type of the pointer value "((unsigned char ...)((mhdr)+1))" is "unsigned char", which is not compatible with "char". (ptrmismatch) add_assoc_string(control_array, "cmsg_data", CMSG_DATA(mhdr), 1); -------------------------------------------------------------------------------------^ cc: Error: sockets.c, line 1608: In this statement, "msg_controllen" is not a member of "hdr". (needmember) Z_LVAL_PP(controllen) = hdr.msg_controllen; ----------------------------------------------------------------^ cc: Error: sockets.c, line 1609: In this statement, "msg_flags" is not a member of "hdr". (needmember) Z_LVAL_PP(flags) = hdr.msg_flags; ----------------------------------------------------------------^ cc: Warning: sockets.c, line 1635: In this statement, the referenced type of the pointer value "sun" is "struct sockaddr_un", which is not compatible with "char". (ptrmismatch) hdr.msg_name = sun; ------------------------^ cc: Error: sockets.c, line 1641: In this statement, "msg_control" is not a member of "hdr". (needmember) hdr.msg_control = ctl_buf; --------------------------------^ cc: Error: sockets.c, line 1642: In this statement, "msg_controllen" is not a member of "hdr". (needmember) hdr.msg_controllen = Z_LVAL_PP(controllen); --------------------------------^ cc: Error: sockets.c, line 1644: In this statement, "msg_control" is not a member of "hdr". (needmember) hdr.msg_control = NULL; --------------------------------^ cc: Error: sockets.c, line 1645: In this statement, "msg_controllen" is not a member of "hdr". (needmember) hdr.msg_controllen = 0; --------------------------------^ cc: Error: sockets.c, line 1648: In this statement, "msg_flags" is not a member of "hdr". (needmember) hdr.msg_flags = 0; ------------------------^ cc: Error: sockets.c, line 1654: In the initializer for mhdr, "msg_control" is not a member of "hdr". (needmember) struct cmsghdr *mhdr = (struct cmsghdr *) hdr.msg_control; --------------------------------------------------------------------------^ cc: Warning: sockets.c, line 1663: In this statement, the referenced type of the pointer value "((unsigned char ...)((mhdr)+1))" is "unsigned char", which is not compatible with "char". (ptrmismatch) add_assoc_string(control_array, "cmsg_data", CMSG_DATA(mhdr), 1); -----------------------------------------------------------------------------^ cc: Error: sockets.c, line 1665: In this statement, "msg_controllen" is not a member of "hdr". (needmember) Z_LVAL_PP(controllen) = hdr.msg_controllen; --------------------------------------------------------^ cc: Error: sockets.c, line 1666: In this statement, "msg_flags" is not a member of "hdr". (needmember) Z_LVAL_PP(flags) = hdr.msg_flags; --------------------------------------------------------^ cc: Warning: sockets.c, line 1714: In this statement, the referenced type of the pointer value "&sa" is "struct sockaddr", which is not compatible with "char". (ptrmismatch) hdr.msg_name = &sa; --------------------------------^ cc: Warning: sockets.c, line 1738: In this statement, the referenced type of the pointer value "sun" is "struct sockaddr_un", which is not compatible with "char". (ptrmismatch) hdr.msg_name = sun; --------------------------------^ cc: Warning: /home/long/src/php-4.0.2/Zend/zend_execute.h, line 174: There is no function named zend_assign_to_variable_reference defined in this compilation unit. (nofunc) ZEND_API inline void zend_assign_to_variable_reference(znode *result, zval **variable_ptr_ptr, zval **value_ptr_ptr, temp_variable *Ts ELS_DC) ---------------------^ cc: Warning: /home/long/src/php-4.0.2/Zend/zend_execute.h, line 131: There is no function named zend_ptr_stack_get_arg defined in this compilation unit. (nofunc) ZEND_API inline int zend_ptr_stack_get_arg(int requested_arg, void **data ELS_DC) --------------------^ cc: Warning: /home/long/src/php-4.0.2/Zend/zend_execute.h, line 115: There is no function named zend_ptr_stack_clear_multiple defined in this compilation unit. (nofunc) ZEND_API inline void zend_ptr_stack_clear_multiple(ELS_D) ---------------------^ cc: Warning: /home/long/src/php-4.0.2/Zend/zend_execute.h, line 71: There is no function named i_zend_is_true defined in this compilation unit. (nofunc) ZEND_API inline int i_zend_is_true(zval *op) --------------------^ cc: Warning: /home/long/src/php-4.0.2/Zend/zend_execute.h, line 57: There is no function named safe_free_zval_ptr defined in this compilation unit. (nofunc) ZEND_API inline void safe_free_zval_ptr(zval *p) ---------------------^ cc: Warning: /home/long/src/php-4.0.2/Zend/zend_operators.h, line 61: There is no function named is_numeric_string defined in this compilation unit. (nofunc) ZEND_API inline int is_numeric_string(char *str, int length, long *lval, double *dval) --------------------^ *** Exit 1 Stop. *** Exit 1 Stop. *** Exit 1 Stop. *** Exit 1 Stop. The man page for getsockname() indicates that to use the struct sockaddr like the sockets extension tries to use requires defining _SOCKADDR_LEN before including <sys/sockets.h>. I tried doing that but that apparently changes the function naming for getsockname() thus screwing up the PHP_FUNCTION and PHP_FE macros and causing the compile to continue to fail: Making all in sockets /bin/sh /home/long/src/php-4.0.2/libtool --silent --mode=compile cc -I. -I/home/long/src/php-4.0.2/ext/sockets -I/home/long/src/php-4.0.2 -I/home/long/src/php-4.0.2/main -I/home/long/src/php-4.0.2/Zend -I/home/long/src/php-4.0.2 -I/usr/local/include -I/usr/local/Hughes/include -I/home/long/src/php-4.0.2/ext/mysql/libmysql -I/home/oracle/u01/app/oracle/product/8.0.5/rdbms/demo -I/home/oracle/u01/app/oracle/product/8.0.5/network/public -I/home/oracle/u01/app/oracle/product/8.0.5/plsql/public -I/home/long/src/php-4.0.2/ext/xml/expat/xmltok -I/home/long/src/php-4.0.2/ext/xml/expat/xmlparse -DXML_BYTE_ORDER=12 -ifo -O2 -c sockets.c cc: Error: sockets.c, line 112: In the initializer for sockets_functions[14].handler, "php_if_ngetsockname" is not declared. (undeclared) PHP_FE(getsockname, second_and_third_args_force_ref) /* OK */ --------^ cc: Error: sockets.c, line 113: In the initializer for sockets_functions[15].handler, "php_if_ngetpeername" is not declared. (undeclared) PHP_FE(getpeername, second_and_third_args_force_ref) /* OK */ --------^ cc: Error: sockets.c, line 118: In the initializer for sockets_functions[20].handler, "php_if__recv_OBSOLETE_" is not declared. (undeclared) PHP_FE(recv, second_arg_force_ref) --------^ cc: Error: sockets.c, line 119: In the initializer for sockets_functions[21].handler, "php_if__send_OBSOLETE_" is not declared. (undeclared) PHP_FE(send, NULL) --------^ cc: Error: sockets.c, line 120: In the initializer for sockets_functions[22].handler, "php_if_nrecvfrom" is not declared. (undeclared) PHP_FE(recvfrom, second_fifth_and_sixth_args_force_ref) --------^ cc: Error: sockets.c, line 128: In the initializer for sockets_functions[30].handler, "php_if_nrecvmsg" is not declared. (undeclared) PHP_FE(recvmsg, third_through_seventh_args_force_ref) --------^ cc: Error: sockets.c, line 129: In the initializer for sockets_functions[31].handler, "php_if_nsendmsg" is not declared. (undeclared) PHP_FE(sendmsg, NULL) --------^ cc: Warning: sockets.c, line 877: In this statement, the referenced type of the pointer value "&sa" is "struct sockaddr", which is not compatible with "struct sockaddr_in". (ptrmismatch) sin = &sa; ------------------------^ cc: Warning: sockets.c, line 902: In this statement, the referenced type of the pointer value "&sa" is "struct sockaddr", which is not compatible with "struct sockaddr_un". (ptrmismatch) sun = &sa; ------------------------^ cc: Warning: sockets.c, line 929: In this statement, "hstrerror(...)" of type "int", is being converted to "pointer to const char". (cvtdiftypes) buf = hstrerror(-(Z_LVAL_PP(error))); ----------------^ cc: Warning: sockets.c, line 966: In this statement, the referenced type of the pointer value "&length" is "unsigned long", which is not compatible with "int". (ptrmismatch) ret = getsockname(Z_LVAL_PP(arg0), &sock_type, &length); -------------------------------------------------------^ cc: Warning: sockets.c, line 973: In this statement, the referenced type of the pointer value "&sa" is "struct sockaddr_un", which is not compatible with "const struct sockaddr". (ptrmismatch) ret = bind(Z_LVAL_PP(arg0), &sa, SUN_LEN(&sa)); --------------------------------------------^ cc: Warning: sockets.c, line 996: In this statement, the referenced type of the pointer value "&sa" is "struct sockaddr_in", which is not compatible with "const struct sockaddr". (ptrmismatch) ret = bind(Z_LVAL_PP(arg0), &sa, sizeof(sa)); --------------------------------------------^ cc: Warning: sockets.c, line 1454: In this statement, the referenced type of the pointer value "&salen" is "unsigned long", which is not compatible with "int". (ptrmismatch) ret = getsockname(Z_LVAL_PP(fd), &sa, &salen); ----------------------------------------------^ cc: Warning: sockets.c, line 1473: In this statement, the referenced type of the pointer value "&sun" is "struct sockaddr_un", which is not compatible with "const struct sockaddr". (ptrmismatch) Z_LVAL_PP(flags), &sun, SUN_LEN(&sun)); ---------------------------------------------------------------^ cc: Warning: sockets.c, line 1503: In this statement, the referenced type of the pointer value "&sin" is "struct sockaddr_in", which is not compatible with "const struct sockaddr". (ptrmismatch) Z_LVAL_PP(flags), &sin, sizeof(sin)); ---------------------------------------------------------------^ cc: Warning: /home/long/src/php-4.0.2/Zend/zend_execute.h, line 174: There is no function named zend_assign_to_variable_reference defined in this compilation unit. (nofunc) ZEND_API inline void zend_assign_to_variable_reference(znode *result, zval **variable_ptr_ptr, zval **value_ptr_ptr, temp_variable *Ts ELS_DC) ---------------------^ cc: Warning: /home/long/src/php-4.0.2/Zend/zend_execute.h, line 131: There is no function named zend_ptr_stack_get_arg defined in this compilation unit. (nofunc) ZEND_API inline int zend_ptr_stack_get_arg(int requested_arg, void **data ELS_DC) --------------------^ cc: Warning: /home/long/src/php-4.0.2/Zend/zend_execute.h, line 115: There is no function named zend_ptr_stack_clear_multiple defined in this compilation unit. (nofunc) ZEND_API inline void zend_ptr_stack_clear_multiple(ELS_D) ---------------------^ cc: Warning: /home/long/src/php-4.0.2/Zend/zend_execute.h, line 71: There is no function named i_zend_is_true defined in this compilation unit. (nofunc) ZEND_API inline int i_zend_is_true(zval *op) --------------------^ cc: Warning: /home/long/src/php-4.0.2/Zend/zend_execute.h, line 57: There is no function named safe_free_zval_ptr defined in this compilation unit. (nofunc) ZEND_API inline void safe_free_zval_ptr(zval *p) ---------------------^ cc: Warning: /home/long/src/php-4.0.2/Zend/zend_operators.h, line 61: There is no function named is_numeric_string defined in this compilation unit. (nofunc) ZEND_API inline int is_numeric_string(char *str, int length, long *lval, double *dval) --------------------^ *** Exit 1 Stop. *** Exit 1 Stop. *** Exit 1 Stop. *** Exit 1 Stop.

« previous php.dev (#33910) next »