public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: johnb@stl.sarov.ru To: gcc-gnats@gcc.gnu.org Subject: libstdc++/7206: gcc 3.1:rewind(fptr) doesn`t work after fwscanf (fptr,L"%c%c",...) on opened with "w+" file. Date: Thu, 04 Jul 2002 05:26:00 -0000 [thread overview] Message-ID: <20020704122252.4511.qmail@sources.redhat.com> (raw) >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
next reply other threads:[~2002-07-04 12:26 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2002-07-04 5:26 johnb [this message] 2002-07-05 5:10 paolo
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20020704122252.4511.qmail@sources.redhat.com \ --to=johnb@stl.sarov.ru \ --cc=gcc-gnats@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).