ID: 8667
Updated by: cynic
Reported By: [EMAIL PROTECTED]
Status: Open
Bug Type: Sockets related
Assigned To: 
Comments:

From: Ralph Mitchell <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: PHP-4.0.4pl1 bug #8667

I got the exact same result as you mention in bug #8667, on Solaris 6
with gcc 2.95.2.  I was compiling the latest sockets.c, pulled today
from CVS, with this id string:

/* $Id: sockets.c,v 1.32 2001/02/26 06:07:16 andi Exp $ */

Believe it or not, moving:

    #include "php_sockets.h"     (line 39)

down to *below* the block of system includes (i.e. after the include for
<sys/uio.h>, line 55) fixed the problem.  Guess php_sockets.h depends on
some system stuff being defined, probably from <sys/socket.h>.

Maybe someone else already spotted this - I may have missed it when I
checked the bug list.


Previous Comments:
---------------------------------------------------------------------------

[2001-02-20 18:20:38] [EMAIL PROTECTED]
Simple but ugly workaround for Solaris 7/8 is to define _KERNEL for sockets.h in 
ext/sockets/sockets.c in PHP.

ext/sockets/socket.c:

#define _KERNEL
#include <sys/socket.h>
#undef _KERNEL

[EMAIL PROTECTED]
[EMAIL PROTECTED]

---------------------------------------------------------------------------

[2001-01-12 10:51:19] [EMAIL PROTECTED]
user feedback:

Nope. I can reproduce this with latest CVS in Solaris 8.. BUT only
when using GCC. With the Sun CC it works fine.


So this bug report should be re-opened.
Here's what I get with latest CVS when using GCC 2.95.2:


safe_mode.c: In function `php_checkuid':
safe_mode.c:127: warning: passing arg 2 of `zend_hash_exists' discards
qualifiers from pointer target type
sockets.c:118: `php_if___xnet_listen' undeclared here (not in a function)
sockets.c:118: initializer element is not constant
sockets.c:118: (near initialization for `sockets_functions[10].handler')
sockets.c:139: `php_if___xnet_socket' undeclared here (not in a function)
sockets.c:139: initializer element is not constant
sockets.c:139: (near initialization for `sockets_functions[16].handler')
sockets.c:140: `php_if___xnet_connect' undeclared here (not in a function)
sockets.c:140: initializer element is not constant
sockets.c:140: (near initialization for `sockets_functions[17].handler')
sockets.c:142: `php_if___xnet_bind' undeclared here (not in a function)
sockets.c:142: initializer element is not constant
sockets.c:142: (near initialization for `sockets_functions[19].handler')
sockets.c:146: `php_if___xnet_sendto' undeclared here (not in a function)
sockets.c:146: initializer element is not constant
sockets.c:146: (near initialization for `sockets_functions[23].handler')
sockets.c:153: `php_if___xnet_recvmsg' undeclared here (not in a function)
sockets.c:153: initializer element is not constant
sockets.c:153: (near initialization for `sockets_functions[30].handler')
sockets.c:154: `php_if___xnet_sendmsg' undeclared here (not in a function)
sockets.c:154: initializer element is not constant
sockets.c:154: (near initialization for `sockets_functions[31].handler')
sockets.c:157: `php_if___xnet_getsockopt' undeclared here (not in a
function)
sockets.c:157: initializer element is not constant
sockets.c:157: (near initialization for `sockets_functions[34].handler')
sockets.c:159: `php_if___xnet_socketpair' undeclared here (not in a
function)
sockets.c:159: initializer element is not constant
sockets.c:159: (near initialization for `sockets_functions[36].handler')
make[3]: *** [sockets.lo] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1


---------------------------------------------------------------------------

[2001-01-12 02:31:49] [EMAIL PROTECTED]
I fixed this compilation problem in the 4.0.5 development tree about a week ago.  See 
revision 1.27 of sockets.c 
(http://cvs.php.net/viewcvs.cgi/php4/ext/sockets/sockets.c.diff?r1=1.26&r2=1.27).

---------------------------------------------------------------------------

[2001-01-12 02:25:27] [EMAIL PROTECTED]
gcc  -I. -I/export/home/art/php-4.0.4pl1/ext/sockets 
-I/export/home/art/php-4.0.4pl1/main -I/export/home/art/php-4.0.4pl1 
-I/export/home/art/apache_1.3.14/src/include 
-I/export/home/art/apache_1.3.14/src/os/unix -I/export/home/art/php-4.0.4pl1/Zend 
-I/export/home/art/c-client/include -I/export/home/art/sdk40/include 
-I/usr/local/mysql/include/mysql -I/export/home/art/php-4.0.4pl1/ext/xml/expat/xmltok 
-I/export/home/art/php-4.0.4pl1/ext/xml/expat/xmlparse 
-I/export/home/art/php-4.0.4pl1/TSRM  -D_POSIX_PTHREAD_SEMANTICS -DXML_BYTE_ORDER=21 
-g -O2  -c sockets.c && touch sockets.lo
sockets.c: In function `php_if_recvmsg':
sockets.c:1728: structure has no member named `msg_control'
sockets.c:1729: structure has no member named `msg_controllen'
sockets.c:1731: structure has no member named `msg_control'
sockets.c:1732: structure has no member named `msg_controllen'
sockets.c:1735: structure has no member named `msg_flags'
sockets.c:1741: structure has no member named `msg_control'
sockets.c:1750: warning: passing arg 3 of `add_assoc_string' makes pointer from 
integer without a cast
sockets.c:1754: structure has no member named `msg_controllen'
sockets.c:1755: structure has no member named `msg_flags'
sockets.c:1787: structure has no member named `msg_control'
sockets.c:1788: structure has no member named `msg_controllen'
sockets.c:1790: structure has no member named `msg_control'
sockets.c:1791: structure has no member named `msg_controllen'
sockets.c:1794: structure has no member named `msg_flags'
sockets.c:1800: structure has no member named `msg_control'
sockets.c:1810: warning: passing arg 3 of `add_assoc_string' makes pointer from 
integer without a cast
sockets.c:1812: structure has no member named `msg_controllen'
sockets.c:1814: structure has no member named `msg_flags'
*** Error code 1
make: Fatal error: Command failed for target `sockets.lo'
Current working directory /export/home/art/php-4.0.4pl1/ext/sockets
*** Error code 1
make: Fatal error: Command failed for target `all-recursive'
Current working directory /export/home/art/php-4.0.4pl1/ext/sockets
*** Error code 1
make: Fatal error: Command failed for target `all-recursive'
Current working directory /export/home/art/php-4.0.4pl1/ext
*** Error code 1
make: Fatal error: Command failed for target `all-recursive'

---------------------------------------------------------------------------



ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=8667&edit=2


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to