public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: libstdc++/4686: Output disappearing after operator<<( streambuf* )
@ 2002-01-13 15:24 rodrigc
  0 siblings, 0 replies; 4+ messages in thread
From: rodrigc @ 2002-01-13 15:24 UTC (permalink / raw)
  To: bkoz, gcc-bugs, gcc-prs, kanze

Synopsis: Output disappearing after operator<<( streambuf* )

State-Changed-From-To: feedback->closed
State-Changed-By: rodrigc
State-Changed-When: Sun Jan 13 15:24:15 2002
State-Changed-Why:
    No feedback.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=4686


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: libstdc++/4686: Output disappearing after operator<<( streambuf* )
@ 2001-10-25 23:35 bkoz
  0 siblings, 0 replies; 4+ messages in thread
From: bkoz @ 2001-10-25 23:35 UTC (permalink / raw)
  To: bkoz, gcc-bugs, gcc-prs, kanze, nobody

Synopsis: Output disappearing after operator<<( streambuf* )

Responsible-Changed-From-To: unassigned->bkoz
Responsible-Changed-By: bkoz
Responsible-Changed-When: Thu Oct 25 23:35:16 2001
Responsible-Changed-Why:
    Mine.
State-Changed-From-To: open->feedback
State-Changed-By: bkoz
State-Changed-When: Thu Oct 25 23:35:16 2001
State-Changed-Why:
    Hmm. Can you try this today (2001-10-25)?
    
    I cann't reproduce this with mainline CVS (gcc-3.1)
    
    -benjamin

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&pr=4686&database=gcc


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: libstdc++/4686: Output disappearing after operator<<( streambuf* )
@ 2001-10-25 21:06 Carlo Wood
  0 siblings, 0 replies; 4+ messages in thread
From: Carlo Wood @ 2001-10-25 21:06 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

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

From: Carlo Wood <carlo@alinoe.com>
To: kanze@gabi-soft.de
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: libstdc++/4686: Output disappearing after operator<<( streambuf* )
Date: Fri, 26 Oct 2001 06:00:57 +0200

 On Thu, Oct 25, 2001 at 05:49:35PM -0000, kanze@gabi-soft.de wrote:
 > #include <sstream>
 > #include <ostream>
 > #include <iostream>
 > 
 > int
 > main()
 > {
 >     std::istringstream  i1( "3\n" ) ;
 >     std::cout << i1.rdbuf() ;
 >     std::cout << "4\n" ;
 >     return 0 ;
 > }
 
 The reason that nothing is written the second time is beause badbit is set
 for std::cout.  It seems to be set here:
 
 0x0804e134 in std::ostream::sentry::~sentry() (__in_chrg=0xbffff510) at /usr/local/gcc-cvs-3.0/include/g++-v3/bits/std_ostream.h:200
 200                   _M_os.setstate(ios_base::badbit);
 (gdb) l
 195             // XXX MT
 196             if (_M_os.flags() & ios_base::unitbuf && !uncaught_exception())
 197               {
 198                 // Can't call flush directly or else will get into recursive lock.
 199                 if (_M_os.rdbuf() && _M_os.rdbuf()->pubsync() == -1)
 200                   _M_os.setstate(ios_base::badbit);
 201               }
 202           }
 
 right after the call to std::cout << i1.rdbuf();
 
 This indeed seems to be a bug, because - this code seems to try to flush
 and sets badbit when that fails.  However, there is nothing to flush because
 std::cout is both 1) unbuffered, 2) empty.  That is hardly a case where
 an *attempt* to flush it can cause an error.
 
 -- 
 Carlo Wood <carlo@alinoe.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* libstdc++/4686: Output disappearing after operator<<( streambuf* )
@ 2001-10-25 16:28 kanze
  0 siblings, 0 replies; 4+ messages in thread
From: kanze @ 2001-10-25 16:28 UTC (permalink / raw)
  To: gcc-gnats

>Number:         4686
>Category:       libstdc++
>Synopsis:       Output disappearing after operator<<( streambuf* )
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Oct 25 16:26:27 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     James Kanze
>Release:        g++ 3.0.0
>Organization:
>Environment:
dxcs8h@~/tmp/gcc (66): uname -a
SunOS dxcs8h 5.7 Generic_106541-12 sun4u sparc SUNW,Ultra-60
dxcs8h@~/tmp/gcc (67): g++3 -v
Reading specs from /opt/global/pkg/gcc-3.0.0_threads/lib/gcc-lib/sparc-sun-solaris2.7/3.0/specs
Configured with: ./configure --prefix=/opt/global/pkg/gcc-3.0.0_threads --enable-threads=posix
Thread model: posix
gcc version 3.0
g++: No input files
>Description:
Output using operator<<( streambuf * ) has
strange behavior.  In the example, the following
output fails to occur.
>How-To-Repeat:
Just compile and look at output.  The there is
no trace of the second output statement.
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="ordbuf.cc"
Content-Disposition: inline; filename="ordbuf.cc"


#include <sstream>
#include <ostream>
#include <iostream>

int
main()
{
    std::istringstream  i1( "3\n" ) ;
    std::cout << i1.rdbuf() ;
    std::cout << "4\n" ;
    return 0 ;
}


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-01-13 23:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-13 15:24 libstdc++/4686: Output disappearing after operator<<( streambuf* ) rodrigc
  -- strict thread matches above, loose matches on Subject: below --
2001-10-25 23:35 bkoz
2001-10-25 21:06 Carlo Wood
2001-10-25 16:28 kanze

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).