Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:12498 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 91566 invoked by uid 1010); 31 Aug 2004 09:34:27 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 91541 invoked from network); 31 Aug 2004 09:34:27 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by pb1.pair.com with SMTP; 31 Aug 2004 09:34:27 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i7V9YQS0030126 for ; Tue, 31 Aug 2004 05:34:26 -0400 Received: from radish.cambridge.redhat.com (radish.cambridge.redhat.com [172.16.18.90]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i7V9YQ332736 for ; Tue, 31 Aug 2004 05:34:26 -0400 Received: from radish.cambridge.redhat.com (localhost.localdomain [127.0.0.1]) by radish.cambridge.redhat.com (8.12.10/8.12.7) with ESMTP id i7V9YPHP015624 for ; Tue, 31 Aug 2004 10:34:25 +0100 Received: (from jorton@localhost) by radish.cambridge.redhat.com (8.12.10/8.12.10/Submit) id i7V9YPfN015623 for internals@lists.php.net; Tue, 31 Aug 2004 10:34:25 +0100 Date: Tue, 31 Aug 2004 10:34:25 +0100 To: internals@lists.php.net Message-ID: <20040831093425.GA15127@redhat.com> Mail-Followup-To: internals@lists.php.net Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline User-Agent: Mutt/1.4.1i Subject: [PATCH] rounding fuzz fix for recent gcc From: jorton@redhat.com (Joe Orton) gcc 3.4.x on x86 optimises the configure test for whether rounding "fuzz" is needed such that the test result flips from true to false, unlike previous gcc releases. The bug24142.t tests for PHP round() then fails, so I presume this is a real problem. Out-of-line-ing the code a little works around this by preventing an inline floor() from being used. --- 4.3/ext/standard/config.m4 10 May 2004 07:25:11 -0000 1.47.2.14 +++ 4.3/ext/standard/config.m4 19 Aug 2004 13:55:54 -0000 @@ -234,8 +234,11 @@ AC_MSG_CHECKING([whether rounding works as expected]) AC_TRY_RUN([ #include + double my_floor(double n) { + return floor(n*pow(10,2) + 0.5); + } int main() { - return floor(0.045*pow(10,2) + 0.5)/10.0 != 0.5; + return my_floor(0.045)/10.0 != 0.5; } ],[ PHP_ROUND_FUZZ=0.5