libstdc++/9662: Can't mix wcout with stdout

peturr02@ru.is peturr02@ru.is
Tue Feb 11 13:06:00 GMT 2003


>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;
}



More information about the Gcc-bugs mailing list