libstdc++/8399: sync_with_stdio(false) breaks unformatted input

marc-oliver.gewaltig@hre-ftr.f.rd.honda.co.jp marc-oliver.gewaltig@hre-ftr.f.rd.honda.co.jp
Wed Oct 30 03:06:00 GMT 2002


>Number:         8399
>Category:       libstdc++
>Synopsis:       sync_with_stdio(false) breaks unformatted input
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Oct 30 02:26:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     marc-oliver.gewaltig@hre-ftr.f.rd.honda.co.jp
>Release:        gcc 3.1, gcc 3.2
>Organization:
>Environment:
Solaris 8, Suse Linux 8.0, and probably all others
>Description:
Unformatted input breaks if synchronisation with stdio
is set to false:
istream members
char get()
get(char &)
read(char *, size_t)
will only return on EOF and SIGINT
>How-To-Repeat:
Compile and start the program.
1. the prompt will appear once and get will
   never return. Same applies to other flavours of get
   and read. I did not test getline though.
2.  If sync_with_stdio(false) is removed, the program
   works as expected and shows a prompt after each <RETURN>
>Fix:

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

I2luY2x1ZGUgPGNhc3NlcnQ+CiNpbmNsdWRlIDxpb3N0cmVhbT4KCmludCBtYWluKCkKewogIHN0
ZDo6aW9zOjpzeW5jX3dpdGhfc3RkaW8oZmFsc2UpOwoKICBjaGFyIGM7CiAgc3RkOjppc3RyZWFt
ICppbj0mc3RkOjpjaW47CgogIGRvCiAgICB7CgogICAgICBhc3NlcnQoaW4tPmdvb2QoKSk7CiAg
ICAgIGFzc2VydCghaW4tPmZhaWwoKSk7CiAgICAgIGFzc2VydCghIGluLT5lb2YoKSk7CgogICAg
ICBzdGQ6OmNlcnIgPDwgImM9ICI7CiAgICAgIGluLT5nZXQoYyk7CiAgICAgIHN0ZDo6Y2VyciA8
PCBjIDw8IHN0ZDo6ZW5kbDsKCiAgICAgIGFzc2VydChpbi0+Z29vZCgpKTsKICAgICAgYXNzZXJ0
KCFpbi0+ZmFpbCgpKTsKICAgICAgYXNzZXJ0KCEgaW4tPmVvZigpKTsKCQogICAgfXdoaWxlIChj
ICE9ICdxJyk7CiAgcmV0dXJuIDA7Cn0K



More information about the Gcc-bugs mailing list