public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: libstdc++/8874: using rdbuf to copy from an empty file sets the fail bit on the target stream
@ 2002-12-11 10:11 bkoz
  0 siblings, 0 replies; 3+ messages in thread
From: bkoz @ 2002-12-11 10:11 UTC (permalink / raw)
  To: bkoz, gcc-bugs, gcc-prs, nick.wells, nobody

Synopsis: using rdbuf to copy from an empty file sets the fail bit on the target stream

Responsible-Changed-From-To: unassigned->bkoz
Responsible-Changed-By: bkoz
Responsible-Changed-When: Wed Dec 11 10:11:46 2002
Responsible-Changed-Why:
    Mine.
State-Changed-From-To: open->feedback
State-Changed-By: bkoz
State-Changed-When: Wed Dec 11 10:11:46 2002
State-Changed-Why:
    This is not a bug.
    
    27.6.2.5.3 - basic_ostream::operator<< [lib.ostream.inserters]
    
    Says:
    
    -8- If the function inserts no characters, it calls setstate(failbit)
    
    -benjamin

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


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

* Re: libstdc++/8874: using rdbuf to copy from an empty file sets the fail bit on the target stream
@ 2003-01-06 20:46 bkoz
  0 siblings, 0 replies; 3+ messages in thread
From: bkoz @ 2003-01-06 20:46 UTC (permalink / raw)
  To: bkoz, gcc-bugs, gcc-prs, nick.wells

Synopsis: using rdbuf to copy from an empty file sets the fail bit on the target stream

State-Changed-From-To: feedback->closed
State-Changed-By: bkoz
State-Changed-When: Mon Jan  6 12:46:57 2003
State-Changed-Why:
    Not a bug

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


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

* libstdc++/8874: using rdbuf to copy from an empty file sets the fail bit on the target stream
@ 2002-12-08  7:56 nick.wells
  0 siblings, 0 replies; 3+ messages in thread
From: nick.wells @ 2002-12-08  7:56 UTC (permalink / raw)
  To: gcc-gnats


>Number:         8874
>Category:       libstdc++
>Synopsis:       using rdbuf to copy from an empty file sets the fail bit on the target stream
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Dec 08 07:56:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Nick Wells
>Release:        gcc version 3.2 20020903 (Red Hat Linux 8.0 3.2-7)
>Organization:
>Environment:
Linux RedHat 8.0 i686 (Dell Precision 220)
>Description:
when you copy from an empty file using the os << fs.rdbuf() idiom the failbit is set on the output stream. See sample code.
>How-To-Repeat:
compile and run the program (I have used /etc/passwd as a 'good' file and /dev/null as a 'bad' file but any file would do.
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="rdbuf.C"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="rdbuf.C"

I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8ZnN0cmVhbT4KI2luY2x1ZGUgPHN0cmluZz4K
CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgoKdm9pZCBmKG9zdHJlYW0gJiB0bywgY29uc3QgY2hhciAq
IGNvbnN0IGZpbGVuYW1lKQp7CiAgICBpZnN0cmVhbSBmcm9tKGZpbGVuYW1lKTsKICAgIGlmICgh
IGZyb20pCWNlcnIgPDwgImNhbid0IG9wZW4gIiA8PCBmaWxlbmFtZSA8PCBlbmRsOwogICAgZWxz
ZQoJdG8gPDwgZnJvbS5yZGJ1ZigpIDw8IGVuZGw7CgogICAgY2VyciA8PCAiZnJvbSA9ICIgPDwg
ZmlsZW5hbWUgPDwgZW5kbDsKICAgIGNlcnIgPDwgInRvLmJhZGJpdCA9ICIgPDwgdG8uYmFkKCkg
PDwgIiwgdG8uZW9mYml0ID0gIiA8PCB0by5lb2YoKSA8PCAiLCB0by5mYWlsYml0ID0gIiA8PCB0
by5mYWlsKCkgPDwgZW5kbDsKICAgIGNlcnIgPDwgImZyb20uYmFkYml0ID0gIiA8PCBmcm9tLmJh
ZCgpIDw8ICIsIGZyb20uZW9mYml0ID0gIiA8PCBmcm9tLmVvZigpIDw8ICIsIGZyb20uZmFpbGJp
dCA9ICIgPDwgZnJvbS5mYWlsKCkgPDwgZW5kbDsKfQoKbWFpbihpbnQgYXJnYywgY2hhciAqKiBh
cmd2KQp7CiAgICBvZnN0cmVhbSB0bygiLi90ZXN0LnJkYnVmLm91dCIpOwogICAgCiAgICBmKHRv
LCAiL2V0Yy9wYXNzd2QiKTsKICAgIGYodG8sICIvZGV2L251bGwiKTsKfQo=


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

end of thread, other threads:[~2003-01-06 20:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-11 10:11 libstdc++/8874: using rdbuf to copy from an empty file sets the fail bit on the target stream bkoz
  -- strict thread matches above, loose matches on Subject: below --
2003-01-06 20:46 bkoz
2002-12-08  7:56 nick.wells

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).