[PHP-DEV] Bug #6942: php sockets unusable with irix-OS From: melchers <email protected>
Date: 09/29/00

From: melchers <email protected>
Operating system: IRIX-6.5.8
PHP version: 3.0.16
PHP Bug Type: Compile Warning
Bug description: php sockets unusable with irix-OS

(using php-3.0.17RC1)
file functions/fsock.c line 677:

cc: WARNING File = functions/fsock.c, Line = 677
  An unsigned integer is being compared to zero.

size_t _php3_sock_fread(char *ptr, size_t size, int socket)
{
        size_t ret = 0;
        SOCK_FIND_AND_READ_MAX(size);
        
        if(size < 0) return ret;
                ^

irix defines these types:
typedef unsigned int size_t;
typedef int ssize_t;
or
typedef unsigned long size_t;
typedef long ssize_t;
(dependent of 32/64 bit interface)
In both cases size_t is unsigned.
Therefore the function _php3_sock_fread()
returns never 0, if there are no data
at the socket to read. This makes socket
communication unusable with irix.

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>