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]

libstdc++/3655: Subject: stream bug with "0xBlabla" strings in internal mode



>Number:         3655
>Category:       libstdc++
>Synopsis:       Subject: stream bug with "0xBlabla" strings in internal mode
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jul 11 16:56:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Samuel Krempp <krempp@cmla.ens-cachan.fr>
>Release:        3.0 and 3.1
>Organization:
>Environment:
i686-pc-linux-gnu
>Description:
The bug was reproduced with the following g++ :
gcc version 3.1 20010624 (experimental) - cvs
gcc version 3.1 20010707 (experimental) - cvs
gcc version 3.0 20010402 (Debian prerelease)
i686-pc-linux-gnu

and is not present in
gcc version 2.95.4 20010319 (Debian prerelease)

With the faulty compilers, the resulting string looks like :
Trap!ZZZÜø

(the 2 last chars vary, clearly comig from improper memory accesses)

hth,
-- 
Sam
>How-To-Repeat:
#include <cassert>
#include <iostream>
#include <sstream>

int main(){
  using namespace std;
  stringstream oss;
  oss.setf(std::ostream::internal, std::ostream::adjustfield);
  oss.width(10);
  oss.fill('Z');
  oss << "0xTrap!";
  cout << oss.str() << endl;

  assert( oss.str() == "ZZZ0xTrap!" );

}

>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]