From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/6730 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: Wrong wcsnrtombs return value and positive NaNs printing Date: Thu, 18 Dec 2014 14:12:52 -0500 Message-ID: <20141218191252.GS4574@brightrain.aerifal.cx> References: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1418929995 10246 80.91.229.3 (18 Dec 2014 19:13:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 18 Dec 2014 19:13:15 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-6743-gllmg-musl=m.gmane.org@lists.openwall.com Thu Dec 18 20:13:08 2014 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1Y1gVX-0003Ti-5e for gllmg-musl@m.gmane.org; Thu, 18 Dec 2014 20:13:07 +0100 Original-Received: (qmail 7766 invoked by uid 550); 18 Dec 2014 19:13:05 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 7756 invoked from network); 18 Dec 2014 19:13:05 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:6730 Archived-At: On Thu, Dec 18, 2014 at 08:20:00PM +0300, Oleg Ranevskyy wrote: > Hello musl community, > > I encountered two problems with musl when running the LLVM libc++ tests > linked against it. > > 1. The wcsnrtombs function returns the number of converted wide chars > instead of the dst length in bytes. "cnt++;" at the of the function should > actually be "cnt += l;". This looks like you're correct, especially considering it's cnt+=l in the first loop. I'll recheck it and fix if I confirm. Thanks. > 2. If a NaN value is printed by vfprintf and the MARK_POS flag is set to > add '+' to positive values, musl doesn't add '+'. I found the following > statement on the musl web page: "Quiet nans are treated equally (there is > only one logical nan value, it is printed as "nan", the library does not > care about the sign and payload of nan)". However, Linux libc adds '+', > boost also has special support for this. Absence of the sign breaks one of > the LLVM libc++ tests. Is this a subject for change? Based on my reading of the spec I think you're right that it should be there. I can fix this. Rich