I'm kind of confused if I'm not doing anything wrong, but following code:
#include <stdio.h>
int main()
{
fputws(L"this fails.\n", stderr);
return 0;
}
crashes for me with the following exception:
Unhandled exception at 0x56BEDABC (msvcr110.dll) in errors.exe: 0xC0000005: Access violation reading location 0x000000A4.
I'm using MSVC2012.
I tried to
I've got following version:
Microsoft Visual Studio Professional 2012
Version 11.0.50727.1 RTMREL
Microsoft .NET Framework
Version 4.5.50709
I finally managed to google the issue, but it wasn't mentioned on SO before, so the link is following:
http://connect.microsoft.com/VisualStudio/feedback/details/772585/fputws-yields-access-violation
VS2012update1 fixes the problem. msvcr110d.dll version is 11.00.51106.1.
Another workaround is to use fputs("", stderr);
before using the fwputs
, to initialize the IO streams properly.
User contributions licensed under CC BY-SA 3.0