This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

libstdc++/7636: ofstream corrupts first 16k of text file output


>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:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]