Re: Re: cvs: php-src(PHP_5_2) /ext/bz2 bz2_filter.c
| From: | Michael Wallner | Date: | Wed, 21 Jun 2006 17:32:45 +0000 |
| Subject: | Re: Re: cvs: php-src(PHP_5_2) /ext/bz2 bz2_filter.c | ||
| References: | 1 2 3 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-38859@lists.php.net to get a copy of this message | ||
Stefan Esser wrote:
mike@honeybadger:~/devel/testimonials$ cat printf.c #include <stdio.h> int main(int argc, char *argv[]) {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.
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;
}
mike@honeybadger:~/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’
mike@honeybadger:~/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)
mike@honeybadger:~/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