From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/169 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: cluts - numeric test expectations Date: Thu, 14 Jul 2011 23:37:29 -0400 Message-ID: <20110715033729.GP16618@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1310701619 25898 80.91.229.12 (15 Jul 2011 03:46:59 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 15 Jul 2011 03:46:59 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-253-gllmg-musl=m.gmane.org@lists.openwall.com Fri Jul 15 05:46:54 2011 Return-path: Envelope-to: gllmg-musl@lo.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by lo.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1QhZMc-0005Px-42 for gllmg-musl@lo.gmane.org; Fri, 15 Jul 2011 05:46:54 +0200 Original-Received: (qmail 20331 invoked by uid 550); 15 Jul 2011 03:46:53 -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 20323 invoked from network); 15 Jul 2011 03:46:53 -0000 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:169 Archived-At: I've been reviewing the numeric tests in cluts some more and based on discussions in the previous thread and on irc, here's where things seem to stand: Tests which expect strto* on "0x[junk]" to fail rather than returning 0 with endptr pointing at the 'x': both my interpretation of the standard and glibc agree that this expectation is wrong, as does at least one expert I asked. I think these should be changed to accept the current musl and glibc behavior and treat anything else as a failure. (Note that the scanf tests, however, seem to be fine.) Tests which expect *endptr==str after overflow (ERANGE): I believe this expectation is incorrect, but glibc seems to disagree. I can't find any language in the standard to support the behavior explicitly, or to allow it as an interpretation. The definition of "subject sequence" makes no reference to the value having to fit in a certain-size integer type, only that it belong to a clearly-defined regular language, e.g. /[-+]?(0x)?[[:xdigit:]]+/ for base==16. Otherwise, all the integer tests look okay. I still need to review the floating point ones. Rich