libstdc++/9662: Can't mix wcout with stdout
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
>Release:        gcc-3.2.1
Red Hat Linux 8.0
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.
See attachment.

Content-Type: text/plain; name=""
Content-Disposition: inline; filename=""

#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