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++/9527: gcc-3.2.1 strstreams and hidden linux glibc dependencies


>Number:         9527
>Category:       libstdc++
>Synopsis:       gcc-3.2.1 strstreams and hidden linux glibc dependencies
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jan 31 15:46:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     o.flebbe@science-computing.de
>Release:        since gcc-3.2.1
>Organization:
>Environment:
Linux, RedHat 7.1 and Suse 7.2 (glibc 2.2.2)
>Description:
Using the libstdc++.so.5.0.1 from 3.2.1 onwards (also tried a snapshot):

On Linux using a glibc 2.2.2 system C++ strings like "1e-6" cannot be converted to doubles. The attached program is expected to output -3e-20, but it prints 12345.

Using the libstc++.so.5.0.0 from 3.2 we will get correct results.

Upgrading the libc seems to be a workaround but not feasable because of multiple other dependencies.

#include <string>
#include <iostream>
#include <sstream>


int main() {

  std::istringstream iss("-3e-20");
  double ret= 12345;
  iss >> ret;

  std::cout << ret << "\n";
}

>How-To-Repeat:
Compile attached code and let it run. It should print -3e-20, but on a suse 7.2 or RedHat 7.1 system (a glibc 2.2.2) it prints 12345.
>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]