X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-4.0 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,SARE_SUB_PCT_LETTER X-Spam-Check-By: sourceware.org MIME-Version: 1.0 Date: Mon, 11 Jun 2012 14:37:30 +0200 Message-ID: Subject: s?wprintf family of functions has broken %s formatter output From: =?UTF-8?Q?V=C3=A1clav_Zeman?= To: cygwin AT cygwin DOT com Content-Type: multipart/mixed; boundary=047d7b15a8c30dde9704c2319dd5 X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com --047d7b15a8c30dde9704c2319dd5 Content-Type: text/plain; charset=UTF-8 Hi. I believe that I have discovered a bug in Cygwin's/Newlib's implementation of s?wprintf() family of functions. They seem to print only the first character in given string parameter. I am attaching a test case and here is the broken output: `--> ./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. -- VZ --047d7b15a8c30dde9704c2319dd5 Content-Type: text/plain; charset=US-ASCII; name="testvswprintf.cxx.txt" Content-Disposition: attachment; filename="testvswprintf.cxx.txt" Content-Transfer-Encoding: base64 X-Attachment-Id: f_h3bixnsv0 I2luY2x1ZGUgPGNzdGRpbz4KI2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVk ZSA8bG9jYWxlPgojaW5jbHVkZSA8Y2xvY2FsZT4KCmludAptYWluICgpCnsK ICAgIC8vIFNldHRpbmcgbG9jYWxlIGhhcyBubyBlZmZlY3Qgb24gdGhlIHBy b2JsZW0uCiAgICAvL3N0ZDo6bG9jYWxlOjpnbG9iYWwgKHN0ZDo6bG9jYWxl ICgpKTsKICAgIC8vc3RkOjpzZXRsb2NhbGUgKExDX0FMTCwgImVuX1VTLlVU Ri04Iik7CgogICAgd2NoYXJfdCBidWZbMTAyNF0gPSB7fTsKICAgIHdjaGFy X3QgY29uc3QgdGV4dFtdID0gTCJUSElTIElTIEEgVEVTVCI7CgogICAgc3Rk Ojp3cHJpbnRmIChMInRoaXMgd29ya3MsICVkLCAlZCwgJWQuLi5cbmJ1dCB0 aGUgZm9sbG93aW5nIGRvZXMgbm90OlxuIiwKICAgICAgICAxLCAyLCAzKTsK CiAgICBpbnQgcmV0ID0gc3RkOjpzd3ByaW50ZiAoYnVmLCBzaXplb2YgKGJ1 ZikgLyBzaXplb2YgKGJ1ZlswXSksIEwiJXMiLAogICAgICAgIHRleHQpOwog ICAgc3RkOjp3Y291dCA8PCAicmV0OiAiIDw8IHJldCA8PCAiXG4iCiAgICAg ICAgICAgICAgIDw8ICJidWY6ID4iIDw8IGJ1ZiA8PCAiPCIgPDwgc3RkOjpl bmRsOwoKICAgIHJldCA9IHN0ZDo6d3ByaW50ZiAoTCI+JXM8XG4iLCB0ZXh0 KTsKICAgIHN0ZDo6ZmZsdXNoIChzdGRvdXQpOwogICAgc3RkOjp3Y291dCA8 PCAicmV0OiAiIDw8IHJldCA8PCAiXG4iOwoKICAgIHN0ZDo6d2NvdXQgPDwg Indjb3V0OiA+IiA8PCB0ZXh0IDw8ICI8XG4iOwp9Cg== --047d7b15a8c30dde9704c2319dd5 Content-Type: text/plain; charset=us-ascii -- 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 --047d7b15a8c30dde9704c2319dd5--