This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: eb77.C
- To: oliva at dcc dot unicamp dot br (Alexandre Oliva)
- Subject: Re: eb77.C
- From: Joern Rennecke <amylaar at cygnus dot co dot uk>
- Date: Wed, 17 Feb 1999 02:16:20 +0000 (GMT)
- Cc: robertlipe at usa dot net, egcs at cygnus dot com
> > Since the constructor for strstream is empty, this invokes undefined
> > behaviour.
>
> It is not empty, and it seems to me that it should not invoke
> undefined behavior.
Look at this code from egcs/libio/strstream.h and tell be what
strstream::strstram () does:
class strstream : public strstreambase, public iostream {
public:
strstream() { }
strstream(char *cp, int n, int mode=ios::out) :strstreambase(cp,n,mode){}
_IO_ssize_t pcount() { return ((strstreambuf*)_strbuf)->pcount(); }
char *str() { return ((strstreambuf*)_strbuf)->str(); }
void freeze(int n = 1) { ((strstreambuf*)_strbuf)->freeze(n); }
int frozen() { return ((strstreambuf*)_strbuf)->frozen(); }
};