Re: PHP 4.0 Bug #9360: Type of the parameter conflicts with previous declaration of function

From: Date: Wed, 21 Feb 2001 07:33:19 +0000
Subject: Re: PHP 4.0 Bug #9360: Type of the parameter conflicts with previous declaration of function
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-47123@lists.php.net to get a copy of this message
Hi, thanks for your patches. I've already applied some of them. [..] > host_info = gethostbyname(host); > > But host is const char *. So I had to change line to as follows: > host_info = gethostbyname((char *)host); Then your system header files are broken. The correct prototype for gethostbyname as per SUSv3 is struct hostent *gethostbyname(const char *); > host_info = gethostbyname((char *)addr); > But addr is const char *. So I had to change line to as follows: > host_info = gethostbyname((char *)addr); Ditto. > Line 183: > Protoype for getsockopt is: getsockopt(int, int, int, char *, int *). > > However, Line 183 contains: > > if (getsockopt(sockfd, SOL_SOCKET, SO_ERROR, &error, &len) < 0) { > > where error is int and len is socklen_t. I had to change line to as follows: Again, your system headers are at fault here. The correct prototype for getsockopt is int getsockopt(int socket, int level, int option_name, void *restrict option_value, socklen_t *restrict option_len); All parameters in line 183 are compatible with the prototype. > I hope that these types of changes are made, so as to compile > easily on any platform. Yes, we definitely will apply all patches which improve portability. - Sascha

« previous php.dev (#47123) next »