libstdc++/8071: basic_ostream::operator<<(streambuf*) loops forever if streambuf::underflow() leaves gptr() NULL

Jonathan Lennox lennox@cs.columbia.edu
Fri Sep 27 09:16:00 GMT 2002


The following reply was made to PR libstdc++/8071; it has been noted by GNATS.

From: Jonathan Lennox <lennox@cs.columbia.edu>
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: Re: libstdc++/8071: basic_ostream::operator<<(streambuf*) loops forever if streambuf::underflow() leaves gptr() NULL
Date: Fri, 27 Sep 2002 12:10:26 -0400

 --prVVYBvZNE
 Content-Type: text/plain; charset=us-ascii
 Content-Description: message body text
 Content-Transfer-Encoding: 7bit
 
 Here is the additional code, which uses the header file previously
 attached.
 
 
 --prVVYBvZNE
 Content-Type: text/plain
 Content-Disposition: inline;
 	filename="test-syncstream.cxx"
 Content-Transfer-Encoding: 7bit
 
 #include "syncstream.h"
 
 using namespace std;
 
 int main(int argc, char *argv[]) 
 {
   if (argc < 2) {
     cerr << "Usage: " << argv[0] << " [file]" << endl;
     exit(2);
   }
   FILE* c_file = fopen(argv[1], "r");
 
   if (c_file == NULL) {
     perror(argv[1]);
     exit(1);
   }
 
   isyncstream cxx_file(c_file);
 
   cout << cxx_file.rdbuf();
 
   exit(0);
 }
 
 --prVVYBvZNE--



More information about the Gcc-prs mailing list