delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/02/23/12:32:03

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
From: "Dave Korn" <dave DOT korn AT artimi DOT com>
To: <cygwin AT cygwin DOT com>
Subject: RE: 1.5.12: FPU affected by gethostname call
Date: Wed, 23 Feb 2005 17:31:45 -0000
MIME-Version: 1.0
In-Reply-To: <200502231741.48661.r.schulz@dkfz.de>
Message-ID: <SERRANODpxwACMNhooN00000035@SERRANO.CAM.ARTIMI.COM>
X-OriginalArrivalTime: 23 Feb 2005 17:31:45.0993 (UTC) FILETIME=[8C219B90:01C519CD]

----Original Message----
>From: cygwin-owner On Behalf Of Ralf B. Schulz 
>Sent: 23 February 2005 16:42

> Long doubles are 12 byte = 96 bit = sizeof(long double). No matter whether
> stored in memory or in registers, they should have that length, no?

  Oh, that does turn out to be a recent change to gcc.  Hmm.

  Then again, I can't reproduce the problem here.  Maybe that's the AMD vs
Intel difference you were wondering about.  I've got a P4; same OS version
as you though, XpSp1.  It makes no difference if I have the call to
gethostname or not, and it makes no difference if I compile with or without
optimisation.

> In the original code, tolerance is set to 1e-19 instead of 5e-16 if long
> doubles are available. In this case, the code calling gethostname() goes
> into an infinite loop.

  That code is seriously buggy, isn't it?

const long double tolerance = 5e-16;
long   double p1, p2, p3;

   do
   {
       [details omitted]
   }
   while (abs(p1/pp) > tolerance);
          ^^^^^^^^^^^^^^^^^^^^^^

<koff>  I really think that ought to have been *f*abs, should it not?  

  Heh.  Why do people always think they can just ignore compiler warnings?

    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019