This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
libstdc++/2970: complex inserter with extraneous 'ends'
- To: gcc-gnats at gcc dot gnu dot org
- Subject: libstdc++/2970: complex inserter with extraneous 'ends'
- From: theonetruekenny at yahoo dot com
- Date: 27 May 2001 05:31:38 -0000
- Cc: kenny dot simpson at gs dot com
- Reply-To: theonetruekenny at yahoo dot com
>Number: 2970
>Category: libstdc++
>Synopsis: complex inserter with extraneous 'ends'
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat May 26 22:36:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: theonetruekenny@yahoo.com
>Release: cvs gcc 5-26-2001
>Organization:
>Environment:
Looking at source code...
>Description:
In the implementation of operator<< for complex<>, there appears to be an extraneous 'ends'.
In line 86 of complex_io.cc is this line:
__s << '(' << __x.real() << "," << __x.imag() << ')' << ends;
This will actually write "(x,y)\0" to the stringbuffer, then the same to the output stream. This bug was most likely being hidden by bug #2830.
Also note that this 'ends' does not appear in the Standard (or at least the last public draft) in 26.2.6.
>How-To-Repeat:
Observe line 86 of complex_io.cc
>Fix:
remove " << ends" from the line of code.
>Release-Note:
>Audit-Trail:
>Unformatted: