[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#243507: g++-3.3: broken fprintf output for floating-point formatted numbers



Package: g++-3.3
Version: 1:3.3.3-6
Severity: normal

When I use any integer constant number (e.g. '0') as an argument for fprintf
command which is '%f' formatted, the output is broken - probably uninitialized
value. When I use floating-point constant (e.g. '0.0'), everything works fine.

I am not sure if this is the problem with parsing the arguements or with
missing warnings. When I use for example simple prinf command I get the warning
during compilation.

Example:

petr@tuscan:~$ cat test.cc
#include <stdio.h>

int main()
{
  fprintf(stdout, "%f\n", 0);
  fprintf(stdout, "%f\n", 0.0);
  return 0;
}
petr@tuscan:~$ g++-3.3 -Wall test.cc
petr@tuscan:~$ ./a.out 
9.762085
0.000000
petr@tuscan:~$ 


-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)
Kernel: Linux 2.4.22
Locale: LANG=C, LC_CTYPE=C

Versions of packages g++-3.3 depends on:
ii  gcc-3.3                     1:3.3.3-6    The GNU C compiler
ii  gcc-3.3-base                1:3.3.3-6    The GNU Compiler Collection (base 
ii  libc6                       2.3.2.ds1-11 GNU C Library: Shared libraries an
ii  libstdc++5-3.3-dev          1:3.3.3-6    The GNU Standard C++ Library v3 (d

-- no debconf information



Reply to: