Possibly uninitialized variable in include/bits/istream.tcc basic_istream::ignore

Aaron W. LaFramboise aaronraolete36@aaronwl.com
Thu Jun 10 00:57:00 GMT 2004


I've been applying the patch below to fix an uninitialized variable 
warning causing mainline bootstrap to fail.  I have not analyzed the 
logic, so I have no idea what the correct fix is.  Perhaps the while 
loops needs to be changed to a do-while loop?

Aaron W. LaFramboise

Index: gcc/libstdc++-v3/include/bits/istream.tcc
===================================================================
RCS file: /cvsroot/gcc/gcc/libstdc++-v3/include/bits/istream.tcc,v
retrieving revision 1.68
diff -c -3 -p -r1.68 istream.tcc
*** gcc/libstdc++-v3/include/bits/istream.tcc	24 May 2004 09:40:53 
-0000	1.68
--- gcc/libstdc++-v3/include/bits/istream.tcc	8 Jun 2004 02:48:43 -0000
*************** namespace std
*** 655,661 ****
   	    {
   	      const int_type __eof = traits_type::eof();
   	      __streambuf_type* __sb = this->rdbuf();
! 	      int_type __c;

   	      if (__n != numeric_limits<streamsize>::max())
   		--__n;
--- 655,661 ----
   	    {
   	      const int_type __eof = traits_type::eof();
   	      __streambuf_type* __sb = this->rdbuf();
! 	      int_type __c = 0;

   	      if (__n != numeric_limits<streamsize>::max())
   		--__n;



More information about the Libstdc++ mailing list