This is the mail archive of the gcc-bugs@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]

[Bug libstdc++/14125] New: std::ios_base::internal fails


Hi!

Im am Working with the following compiler:

  gcc version 3.2 20020903 (Red Hat Linux 8.0 3.2-7)

and the following program fails:
  
##############################################################

#include <iostream>

using namespace std;

int main(int, char**)
{
  ios_base::fmtflags opts1 = (ios_base::internal | \
			      ios_base::adjustfield);
  
  cout.width(6);
  cout.fill('0');
  cout.setf(opts1);
  cout << -0.6 << endl;
  // -------------------------------------------------
  ios_base::fmtflags opts2 = (ios_base::internal | \
			      ios_base::adjustfield | \
			      ios_base::fixed | \
			      ios_base::showpoint);
  cout.width(6);
  cout.precision(2);
  cout.setf(opts2);
  cout << -0.6 << endl;
}
##############################################################

the output is:

##############################################################
00-0.6
0-0.60
##############################################################

This seems to be wrong!

Harald

-- 
           Summary: std::ios_base::internal fails
           Product: gcc
           Version: 3.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: harald dot hopfes dot hopfes at sysde dot eads dot net
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i386-redhat-linux with libc-2.3.2
  GCC host triplet: i386-redhat-linux with libc-2.3.2
GCC target triplet: i386-redhat-linux with libc-2.3.2


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14125


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