libstdc++/8373: C++ I/O doesn't work under AIX
tudor_hulubei@yahoo.com
tudor_hulubei@yahoo.com
Sun Oct 27 17:16:00 GMT 2002
>Number: 8373
>Category: libstdc++
>Synopsis: C++ I/O doesn't work under AIX
>Confidential: no
>Severity: critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun Oct 27 16:56:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: Tudor Hulubei
>Release: gcc-3.2
>Organization:
>Environment:
AIX 4.3.3
>Description:
C++ I/O doesn't work under AIX as of GCC 3.2. The following program goes into an infinite loop when compiled with -g and segfaults when compiled with -O1:
#include <pthread.h>
#include <iostream>
#include <fstream>
using namespace std;
int
main()
{
ifstream ifs("/etc/passwd", ios::in);
if (!ifs)
return 13;
while (ifs.good() && !ifs.eof())
{
char s[1024];
ifs.getline(s, sizeof(s));
if (strlen(s) == 0)
continue;
cout << s << endl;
}
return 0;
}
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the Gcc-bugs
mailing list