Bug 9827 - [3.3/3.4 Regression]: ostream::operator<<(int) doesn't report output errors.
Summary: [3.3/3.4 Regression]: ostream::operator<<(int) doesn't report output errors.
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libstdc++ (show other bugs)
Version: 3.4.0
: P3 normal
Target Milestone: 3.3
Assignee: Jerry Quinn
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-02-24 09:26 UTC by Pétur Runólfsson
Modified: 2004-04-21 01:46 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
sputnbug.cc (167 bytes, application/octet-stream)
2003-05-21 15:17 UTC, Pétur Runólfsson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pétur Runólfsson 2003-02-24 09:26:00 UTC
ostream::operator<<(int) doesn't change the streams error state if streambuf::overflow returns eof. This works correctly in gcc-3.2.1.

Release:
gcc version 3.4 20030222 (experimental)

Environment:
Red Hat Linux 8.0

How-To-Repeat:
See attachment.
Comment 1 Pétur Runólfsson 2003-02-24 09:26:00 UTC
Fix:
Check _M_failed before writing and set it if the write failed.

http://gcc.gnu.org/ml/libstdc++/2003-02/msg00393.html
http://gcc.gnu.org/ml/libstdc++/2003-03/msg00110.html
Comment 2 Jerry Quinn 2003-03-22 05:19:18 UTC
Responsible-Changed-From-To: unassigned->jlquinn
Responsible-Changed-Why: Fixed the bug
Comment 3 Jerry Quinn 2003-03-22 05:31:18 UTC
State-Changed-From-To: open->closed
State-Changed-Why: Bug fixed in 3.3 and 3.4/mainline.