Bug#32348: va_arg trashes (double)0
Package: libc6
Version: 2.0.7v-1
va_arg turns 0 into 4.85442e-270 [see session below].
[Note that casting 0 to (double)0 doesn't work around the problem.]
--
Raul
bash-2.01$ cat >tes.c
#include <stdio.h>
#include <stdarg.h>
v(long ignore, ...) {
va_list l;
va_start(l, ignore);
printf("%g\n", va_arg(l, double));
}
main(){
v(0);
}
bash-2.01$ make tes&&./tes
cc tes.c -o tes
4.85442e-270
bash-2.01$ ldd tes
libc.so.6 => /lib/libc.so.6 (0x40014000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
bash-2.01$ dpkg -l libc6
Desired=Unknown/Install/Remove/Purge
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name Version Description
+++-===============-==============-============================================
ii libc6 2.0.7v-1 The GNU C library version 2 (run-time files)
bash-2.01$
Reply to: