public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* libstdc++/7206: gcc 3.1:rewind(fptr) doesn`t work after fwscanf (fptr,L"%c%c",...) on opened with "w+" file.
@ 2002-07-04  5:26 johnb
  0 siblings, 0 replies; 2+ messages in thread
From: johnb @ 2002-07-04  5:26 UTC (permalink / raw)
  To: gcc-gnats


>Number:         7206
>Category:       libstdc++
>Synopsis:       gcc 3.1:rewind(fptr) doesn`t work after fwscanf (fptr,L"%c%c",...) on opened with "w+" file.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jul 04 05:26:03 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     johnb@stl.sarov.ru
>Release:        gcc 3.1
>Organization:
>Environment:
Red Hat Linux release 7.2 (Enigma), glibc 2.2.4
>Description:
The rewind() function doesn`t work after first call to fwscanf(), second call to fwscanf() continue reading the stream from last unread position, not the first one as should be after call to rewind(). This situation doesn`t exist with fscanf(). See the testcases.
>How-To-Repeat:
Just compile with gcc 3.1, for example:
$gcc31 wrewind.c -o wrewind
$wrewind

You`ll get "...failed" message.
>Fix:

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

I2luY2x1ZGUgPHN0ZGlvLmg+CgojZGVmaW5lIFBBU1NFRCAgMAojZGVmaW5lCUZBSUxFRCAgMwoK
Ci8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0qLwppbnQgbWFpbih2b2lkKQp7CglGSUxFICpmcHRyOwoJY2hhciBhcmcx
OwoJY2hhciBhcmcyOwoJaW50ICByZXQscmV0MSxyZXQyLHJlc3VsdCxudW07CgogICAgICAgIHJl
dDEgPSAwOwoJcmV0MiA9IDA7CgkKCWlmICgoZnB0ciA9IGZvcGVuKCIuL3Jld2luZC5kYXQiLCJ3
KyIpKSA9PSBOVUxMKSB7CgkJcHJpbnRmICgiVW5hYmxlIHRvIG9wZW4gZmlsZS5cbiIpOwoJCXJl
dHVybiAxOwoJIH0KCQoJaWYgKChyZXQgPSBmcHJpbnRmKGZwdHIsImNkZXJmIikpIDw9IDApIHsK
CQlwcmludGYgKCJVbmFibGUgdG8gd3JpdGUgdG8gZmlsZSB3aXRoIGZwcmludGYoKS5cbiIpOwog
ICAgICAgICAgICAgICAgZmNsb3NlIChmcHRyKTsKCQlyZXR1cm4gMjsKCSB9CgoJcmV3aW5kKGZw
dHIpOwogICAgICAgIHJldDEgPSBmc2NhbmYoZnB0ciwiJWMlYyIsJmFyZzEsJmFyZzIpOwoKCXJl
d2luZChmcHRyKTsKCXJldDIgPSBmc2NhbmYoZnB0ciwiJWMlbiVjIiwmYXJnMSwmbnVtLCZhcmcy
KTsKCglpZiAoYXJnMiAhPSAnZCcpIHsKCSAgICByZXN1bHQgPSBGQUlMRUQ7CiAJICAgIHByaW50
ZiAoInJld2luZCBhZnRlciBmaXJzdCBmc2NhbmYgZmFpbGVkXG4iKTsKCSB9CgllbHNlIHsKCSBw
cmludGYgKCJQYXNzZWRcbiIpOwoJIHJlc3VsdCA9IFBBU1NFRDsKCX0KCQoKICBmY2xvc2UgKGZw
dHIpOwogIHJldHVybiByZXN1bHQ7Cn0K


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

* Re: libstdc++/7206: gcc 3.1:rewind(fptr) doesn`t work after fwscanf (fptr,L"%c%c",...) on opened with "w+" file.
@ 2002-07-05  5:10 paolo
  0 siblings, 0 replies; 2+ messages in thread
From: paolo @ 2002-07-05  5:10 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, johnb, nobody, paolo

Synopsis: gcc 3.1:rewind(fptr) doesn`t work after fwscanf (fptr,L"%c%c",...) on opened with "w+" file.

Responsible-Changed-From-To: unassigned->paolo
Responsible-Changed-By: paolo
Responsible-Changed-When: Fri Jul  5 05:10:08 2002
Responsible-Changed-Why:
    .
State-Changed-From-To: open->closed
State-Changed-By: paolo
State-Changed-When: Fri Jul  5 05:10:08 2002
State-Changed-Why:
    rewind.c (and also wrewind.c, which is missing, by the way)
    is a pure "C" testcase, therefore libstdc++ (as you
    categorized the PR) *cannot* be involved. The problem you
    are reporting, *if* real, would concern the behaviour of
    some "C" library (glibc2.2.4 that is) functions, not gcc
    and this is not the right place to submit it.

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


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

end of thread, other threads:[~2002-07-05 12:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-04  5:26 libstdc++/7206: gcc 3.1:rewind(fptr) doesn`t work after fwscanf (fptr,L"%c%c",...) on opened with "w+" file johnb
2002-07-05  5:10 paolo

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