s?wprintf family of functions has broken %s formatter output
Mon Jun 11 13:25:00 GMT 2012
On 11 June 2012 14:58, Otto Meta <email@example.com> wrote:
>> `--> ./testvswprintf.exe
>> this works, 1, 2, 3...
>> but the following does not:
>> ret: 1
>> buf: >T<
>> ret: 4
>> wcout: >THIS IS A TEST<
>> The same code works well on both Ubuntu with GCC and on Windows with
>> Visual Studio 2010.
> I just tried your test with g++ (Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2:
> $> ./testvswprintf
> this works, 1, 2, 3...
> but the following does not:
> ret: 1
> buf: >T<
> ret: 4
> wcout: >THIS IS A TEST<
> Looks quite the same, so it’s not really a Cygwin-only problem.
> My Ubuntu 11.04 is a bit dated already, so maybe you have a newer
> Ubuntu version with a fixed swprintf?
I have done some more checking and I might have been wrong about the
Ubuntu and Linux in general. It looks like the formatting strings are
incompatible between MSVC and *NIX. It appears that either %S (SUSv2)
or %ls (C99) is needed on *NIX. MSVC switches the meaning of %s for
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
More information about the Cygwin