This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

libstdc++/9548: 64-bit copiling/linking: incorrect results from setf(ios::fixed) or precision(-1)


>Number:         9548
>Category:       libstdc++
>Synopsis:       64-bit copiling/linking: incorrect results from setf(ios::fixed) or precision(-1)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Feb 03 18:16:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Guan-Zhu (Andrew) Xiong
>Release:        gcc version 3.2
>Organization:
>Environment:
Linux Version 2.4.19
SuSE SLES 8 (ppc) - Kernel 2.4.19-ul1-ppc64-SMP (31)
>Description:
=> for 64-bit g++ compiling/linking: 
   "cout.setf(ios::fixed); cout.precision (-1);" 
   does not work as expected.

=> For the given C++ code, after 64-bit g++ compiling,
   if you run it then you will get output:
   -----------------
   Output 30.5 as: 30

   The correct output should be: 
   -----------------
   Output 30.5 as: 30.500000

=> Refenece: ISO C++ standard
   The value passed to precision(int i) must be greater 
   than zero. If the value is negative the floating point
   insertion operators will use the default value 
   which is 6.
>How-To-Repeat:
1) Compile the given code with "g++ 64-bit compiler"
   - e.g., /opt/cross/bin/powerpc64-linux-g++ -o hello x.C
2) Run it - hello
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]