On 11 June 2012 14:58, Otto Meta <otto.m...@sister-shadow.de> wrote: >> `--> ./testvswprintf.exe > >> this works, 1, 2, 3... >> but the following does not: >> ret: 1 >> buf: >T< >>> 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< >>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 wprintf() (http://linux.die.net/man/3/printf).
*big SIGH* -- VZ -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple