This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
libstdc++/7636: ofstream corrupts first 16k of text file output
- From: a dot b dot taylor at sympatico dot ca
- To: gcc-gnats at gcc dot gnu dot org
- Date: 19 Aug 2002 17:42:53 -0000
- Subject: libstdc++/7636: ofstream corrupts first 16k of text file output
- Reply-to: a dot b dot taylor at sympatico dot ca
>Number: 7636
>Category: libstdc++
>Synopsis: ofstream corrupts first 16k of text file output
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Aug 19 10:46:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: Allen B. Taylor
>Release: 3.0.3
>Organization:
>Environment:
DJGPP under Win2K
>Description:
The following C++ program behaves incorrectly (see attached). Examining testio.txt reveals the first 16k bytes or so to be garbage, followed by valid data that would have ordinarily appeared at that point. Lower values for i's limit, like 16000, work fine.
Looks like this is fixed in 3.0.4 (djgpp/v2gnu/gcc304b.zip) and also in 3.1 (djgpp/v2gnu/gcc31b.zip). Just wanted to mention it in case someone wanted to include it in the regression tests.
>How-To-Repeat:
#include <fstream>
main()
{
using namespace std;
ofstream tout("testio.txt");
for (int i = 0; i < 16500; i++)
{
if (i != 0 && i % 72 == 0)
tout << '\n';
tout << 'x';
}
}
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: