public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: rolando8@prtc.net To: gcc-gnats@gcc.gnu.org Subject: c++/5502: wrong output Date: Sat, 26 Jan 2002 15:16:00 -0000 [thread overview] Message-ID: <20020126231019.21960.qmail@sources.redhat.com> (raw) >Number: 5502 >Category: c++ >Synopsis: wrong output >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Sat Jan 26 15:16:03 PST 2002 >Closed-Date: >Last-Modified: >Originator: RoLo >Release: 3.0.2 >Organization: >Environment: Red Hat 7.2 kernel 2.4.18-pre3 AMD Athlon XP 1700+ 128 DDR Motherboard Soyo Dragon + >Description: I open a file to write, read and write again. when the program finish I check the files I created and the out put is not what its suppose to be. only the first write works! I compiled the same program with g++ 2.96 and I got the out put I wanted. so I think this could be some kind of bug. in the How-To-Repeat seccion I included an example code. it creates a file named infile.txt but if I compile it with g++3 I get a wrong output in the file. >How-To-Repeat: #include <fstream> #include <iostream> int main(void) { char a; std::fstream ipo("infile.txt", std::ios::ate | std::ios::out); if (!ipo) { std::cout << "File does not exist."; return -1; } ipo.put('.'); a = ipo.get(); ipo.put('A'); ipo.close(); return 1; } >Fix: >Release-Note: >Audit-Trail: >Unformatted:
next reply other threads:[~2002-01-26 23:16 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2002-01-26 15:16 rolando8 [this message] 2002-01-27 2:12 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=20020126231019.21960.qmail@sources.redhat.com \ --to=rolando8@prtc.net \ --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).