X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:mime-version :content-transfer-encoding:content-type; q=dns; s=default; b=hDN 59fP43Alp2nHUv4/xLrwVM+7idlC1U2CQDZSLiRFQL0SIDQzLdxwctUPCqiGE18M luu7pk7gf8PNSIq0zvmXK/pYXxNtue69vM4x5ydd+0K7uEd1xOVDbYjS7svnTPmy ASck0ZjtoRP/GtWNo7y/hppvAZos4D7/IEy2xbJY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:mime-version :content-transfer-encoding:content-type; s=default; bh=MW1AlYe2e 9xBIgDege5wq4pJLUg=; b=oQf1RAznek/tDJAdvqYlgaY3N1OVlTWJH8a5TpjVP vd5FaHYWkbagInI7IgslCJGg4QfRphUf4jxn8yhaeUcAF+ipxGnNt0fKFhkw4Vhs BBTbvjh1u0XCy3hDMJgF41HIY7QU2I9IbgLeggudppzB/d0UgqdAbf31Xan34KlW QM= 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 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=BAYES_00,KAM_ASCII_DIVIDERS,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS autolearn=no version=3.3.1 spammy=strtod X-HELO: mo4-p00-ob.smtp.rzone.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1576132683; s=strato-dkim-0002; d=clisp.org; h=Message-ID:Date:Subject:To:From:X-RZG-CLASS-ID:X-RZG-AUTH:From: Subject:Sender; bh=akSN2NMqjXsENeEsQWW6UG0z75tlCW8QahU4HciBprE=; b=TXEgo/9Sq15KwUq+RJaxUiXc8adtkBsiCiM84lyaXFNTxJI9x401aSN0vfHoxqQ2yH R098WAc7Pjg+yvdN1wZnEXlD5/k1yQWIleOFzx3NTvhXKip11/N6znSCxgtn/M11qv3s 8LG8qzFfuGNx9yDE4E5ZkYfuYzA4F3qA8Mx8eGWzc8KVvUKmkmhj/Mwg1ZFhOdfas7qV R4TJOfgUJ9trSiYkebzKHeTS8V3hxJI3SIo1/D5QfubddxQEAjGFprhLqk2MwbOyd1IJ xFczdXUtvjz8niTlIwq4/U5nAFPC0WBuMRbgTcdLUSt+mQW50FjkUHsPQDdGGMXBl+7/ qXlQ== From: Bruno Haible To: cygwin AT cygwin DOT com Subject: strtold does not set errno when it should Date: Thu, 12 Dec 2019 07:38:02 +0100 Message-ID: <3561570.L6m47ClBex@omega> User-Agent: KMail/5.1.3 (Linux/4.4.0-166-generic; KDE/5.18.0; x86_64; ; ) MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" POSIX [1] makes it clear that when the value to be returned would cause underflow, it should set errno to ERANGE. [1] This test case fails with error code 4 on Cygwin 2.9. ========================== foo.c ========================== #include #include #include #include int main () { const char input[] = "1E-100000"; char *ptr; long double result; errno = 0; result = strtold (input, &ptr); if (!(ptr == input + 9)) return 1; if (!(0.0L <= result && result <= LDBL_MIN)) return 2; if (signbit (result)) return 3; if (result == 0.0L && errno != ERANGE) return 4; return 0; } ============================================================ $ gcc -Wall foo.c $ ./a.exe $ echo $? 4 The corresponding test case for strtod() / 'double' succeeds. Bruno -- 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