[PHP-CVS] Re: cvs: php-src(PHP_5_2) /ext/bz2 bz2_filter.c

2006-06-21 Thread Michael Wallner

Ilia Alshanetsky wrote:

iliaa   Wed Jun 21 15:19:24 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/bz2	bz2_filter.c 
  Log:

  Fixed compiler warnings.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/bz2/bz2_filter.c?r1=1.3.2.2r2=1.3.2.2.2.1diff_format=u

Index: php-src/ext/bz2/bz2_filter.c
diff -u php-src/ext/bz2/bz2_filter.c:1.3.2.2 
php-src/ext/bz2/bz2_filter.c:1.3.2.2.2.1
--- php-src/ext/bz2/bz2_filter.c:1.3.2.2Sun Jan  1 12:50:00 2006
+++ php-src/ext/bz2/bz2_filter.cWed Jun 21 15:19:23 2006
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: bz2_filter.c,v 1.3.2.2 2006/01/01 12:50:00 sniper Exp $ */

+/* $Id: bz2_filter.c,v 1.3.2.2.2.1 2006/06/21 15:19:23 iliaa Exp $ */
 
 #ifdef HAVE_CONFIG_H

 #include config.h
@@ -274,7 +274,7 @@
/* Create this filter */
data = pecalloc(1, sizeof(php_bz2_filter_data), persistent);
if (!data) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, Failed allocating %d 
bytes., sizeof(php_bz2_filter_data));
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Failed allocating %ld 
bytes., sizeof(php_bz2_filter_data));
return NULL;
}



Hi, I don't know what you're running but here size_t is unsigned int.
It's probably unsigned long on 64bit boxen, so what's this fix about?

Regards,
--
Michael

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] Re: cvs: php-src(PHP_5_2) /ext/bz2 bz2_filter.c

2006-06-21 Thread Stefan Esser

 Hi, I don't know what you're running but here size_t is unsigned int.
 It's probably unsigned long on 64bit boxen, so what's this fix about?
The question is: what are you running? size_t usually is unsigned long.

Stefan

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] Re: cvs: php-src(PHP_5_2) /ext/bz2 bz2_filter.c

2006-06-21 Thread Ilia Alshanetsky
On my 2 32 bit machines the compiler complains about int being used  
where a non-int or a long value is returned. Changing it to long  
fixes the problem, this is replicated on gcc 3.4 and 4.0.1



On 21-Jun-06, at 12:08 PM, Michael Wallner wrote:


Ilia Alshanetsky wrote:

iliaa   Wed Jun 21 15:19:24 2006 UTC
  Modified files:  (Branch: PHP_5_2)
/php-src/ext/bz2bz2_filter.c   Log:
  Fixed compiler warnings.
http://cvs.php.net/viewvc.cgi/php-src/ext/bz2/bz2_filter.c? 
r1=1.3.2.2r2=1.3.2.2.2.1diff_format=u

Index: php-src/ext/bz2/bz2_filter.c
diff -u php-src/ext/bz2/bz2_filter.c:1.3.2.2 php-src/ext/bz2/ 
bz2_filter.c:1.3.2.2.2.1

--- php-src/ext/bz2/bz2_filter.c:1.3.2.2Sun Jan  1 12:50:00 2006
+++ php-src/ext/bz2/bz2_filter.cWed Jun 21 15:19:23 2006
@@ -16,7 +16,7 @@
 
+ 
--+

 */
 -/* $Id: bz2_filter.c,v 1.3.2.2 2006/01/01 12:50:00 sniper Exp $ */
+/* $Id: bz2_filter.c,v 1.3.2.2.2.1 2006/06/21 15:19:23 iliaa Exp  
$ */

  #ifdef HAVE_CONFIG_H
 #include config.h
@@ -274,7 +274,7 @@
/* Create this filter */
data = pecalloc(1, sizeof(php_bz2_filter_data), persistent);
if (!data) {
-		php_error_docref(NULL TSRMLS_CC, E_WARNING, Failed allocating % 
d bytes., sizeof(php_bz2_filter_data));
+		php_error_docref(NULL TSRMLS_CC, E_WARNING, Failed allocating % 
ld bytes., sizeof(php_bz2_filter_data));

return NULL;
}



Hi, I don't know what you're running but here size_t is unsigned int.
It's probably unsigned long on 64bit boxen, so what's this fix about?

Regards,
--
Michael

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Ilia Alshanetsky

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] Re: cvs: php-src(PHP_5_2) /ext/bz2 bz2_filter.c

2006-06-21 Thread Michael Wallner

Stefan Esser wrote:

Hi, I don't know what you're running but here size_t is unsigned int.
It's probably unsigned long on 64bit boxen, so what's this fix about?

The question is: what are you running? size_t usually is unsigned long.


[EMAIL PROTECTED]:~/devel/testimonials$ cat printf.c
#include stdio.h

int main(int argc, char *argv[]) {
   char tmp[3];
   size_t szo = sizeof(tmp);

   printf(%d %u %ld %lu\n, sizeof(tmp), sizeof(tmp), sizeof(tmp), 
sizeof(tmp));
   printf(%d %u %ld %lu\n, szo, szo, szo, szo);
   return 0;
}
[EMAIL PROTECTED]:~/devel/testimonials$ gcc -o printf -Wall printf.c
printf.c: In function ‘main’:
printf.c:7: warning: format ‘%ld’ expects type ‘long int’, but argument 4 has 
type ‘unsigned int’
printf.c:7: warning: format ‘%lu’ expects type ‘long unsigned int’, but 
argument 5 has type ‘unsigned int’
printf.c:8: warning: format ‘%ld’ expects type ‘long int’, but argument 4 has 
type ‘size_t’
printf.c:8: warning: format ‘%lu’ expects type ‘long unsigned int’, but 
argument 5 has type ‘size_t’
[EMAIL PROTECTED]:~/devel/testimonials$ gcc -v
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v 
--enable-languages=c,c++,java,f95,objc,ada,treelang --prefix=/usr 
--enable-shared --with-system-zlib --libexecdir=/usr/lib 
--without-included-gettext --enable-threads=posix --enable-nls 
--program-suffix=-4.0 --enable-__cxa_atexit --enable-clocale=gnu 
--enable-libstdcxx-debug --enable-java-awt=gtk-default --enable-gtk-cairo 
--with-java-home=/usr/lib/jvm/java-1.4.2-gcj-4.0-1.4.2.0/jre --enable-mpfr 
--disable-werror --with-tune=pentium4 --enable-checking=release i486-linux-gnu
Thread model: posix
gcc version 4.0.3 (Ubuntu 4.0.3-1ubuntu5)
[EMAIL PROTECTED]:~/devel/testimonials$ uname -a
Linux honeybadger 2.6.15-23-686 #1 SMP PREEMPT Tue May 23 14:03:07 UTC 2006 
i686 GNU/Linux

I'm running nothing uncommon, I guess?

Regards,
--
Michael

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] Re: cvs: php-src(PHP_5_2) /ext/bz2 bz2_filter.c

2006-06-21 Thread Michael Wallner

Ilia Alshanetsky wrote:
On my 2 32 bit machines the compiler complains about int being used 
where a non-int or a long value is returned. Changing it to long fixes 
the problem, this is replicated on gcc 3.4 and 4.0.1


Ok, well... this seems to differ for me on i686 
(__SIZE_TYPE__ is unsigned int here) and is probably

the reason why PHPs *printf has the %zu format for size_t.

Regards,
--
Michael

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php