c++/394: iostream is broken, streambuf.h needs a patch

rodrigc@mediaone.net rodrigc@mediaone.net
Sun Jul 9 17:46:00 GMT 2000


>Number:         394
>Category:       c++
>Synopsis:       iostream is broken, streambuf.h needs a patch
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jul 09 17:46:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Craig Rodrigues
>Release:        gcc version 2.96 20000709 (experimental)  (obtained from Codesourcery)
>Organization:
>Environment:
Linux kernel 2.2.14
Redhat 6.2
>Description:
Try to compile anything which includes <iostream>
results in a compilation error.
>How-To-Repeat:
Compile this:

#include <iostream>

int main(int, char **)
{
  return 0;
}

Results in this error:

GNU C++ version 2.96 20000709 (experimental) (i386-pc-linux-gnu) compiled by GNU
C version 2.96 20000709 (experimental).
In file included from /usr/local/include/g++-3/iostream.h:32,
                 from /usr/local/include/g++-3/iostream:7,
                 from a.cc:2:
/usr/local/include/g++-3/streambuf.h: In method `_IO_FILE *&streambuf::xchain ()':
/usr/local/include/g++-3/streambuf.h:295: could not convert `this->_IO_FILE::_chain' to `_IO_FILE *&'                  GNU C++ version 2.96 20000709 (experimental) (i386-pc-linux-gnu) compiled by GNU
C version 2.96 20000709 (experimental).
In file included from /usr/local/include/g++-3/iostream.h:32,
                 from /usr/local/include/g++-3/iostream:7,
                 from a.cc:2:
/usr/local/include/g++-3/streambuf.h: In method `_IO_FILE
*&streambuf::xchain ()':
/usr/local/include/g++-3/streambuf.h:295: could not convert `this->_IO_FILE::_chain' to `_IO_FILE *&'
>Fix:
*** /usr/local/include/g++-3/streambuf.h        Sun Jul  9 06:37:51 2000
--- /usr/include/g++-3/streambuf.h      Mon Jul  3 12:53:29 2000
***************
*** 292,298 ****
      const void *&_vtable() { return *(const void**)((_IO_FILE*)this + 1); }
    protected:
      static streambuf* _list_all; /* List of open streambufs. */
!     _IO_FILE*& xchain() { return _chain; }
      void _un_link();
      void _link_in();
      char* gptr() const
--- 292,298 ----
      const void *&_vtable() { return *(const void**)((_IO_FILE*)this + 1); }
    protected:
      static streambuf* _list_all; /* List of open streambufs. */
!     _IO_FILE*& xchain() { return (_IO_FILE*&)_chain; }
      void _un_link();
      void _link_in();
      char* gptr() const


Redhat has applied this fix to the version of gcc they
have on their rawhide ftp site.
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the Gcc-prs mailing list