This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
libstdc++/9662: Can't mix wcout with stdout
- From: peturr02 at ru dot is
- To: gcc-gnats at gcc dot gnu dot org
- Date: 11 Feb 2003 13:01:20 -0000
- Subject: libstdc++/9662: Can't mix wcout with stdout
- Reply-to: peturr02 at ru dot is
>Number: 9662
>Category: libstdc++
>Synopsis: Can't mix wcout with stdout
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue Feb 11 13:06:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: peturr02@ru.is
>Release: gcc-3.2.1
>Organization:
>Environment:
Red Hat Linux 8.0
>Description:
Operations on wcout cause stdout to become byte-oriented (as reported by fwide) and thus prevent the use of fputwc etc. on stdout.
This seems to violate 27.3 [lib.iostream.objects] p2.
>How-To-Repeat:
See attachment.
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="wstdiosync.cc"
Content-Disposition: inline; filename="wstdiosync.cc"
#include <iostream>
#include <cstdio>
#include <cwchar>
#undef NDEBUG
#include <cassert>
int main()
{
using namespace std;
wcout << L"Hello, ";
assert(fwide(stdout, 0) >= 0);
fputws(L"world!\n", stdout);
return 0;
}