delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2011/08/07/08:19:39

X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f
X-Recipient: djgpp-workers AT delorie DOT com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=gamma;
h=mime-version:in-reply-to:references:date:message-id:subject:from:to
:content-type:content-transfer-encoding;
bh=l0vdAvrf1CVcKM7rdHOLKBTtqKdKszPO7ldXehUs3kw=;
b=vTT5+Br3sqG+wE7O5eXGl1mJIIy+R5/Ufv2x6A1dNNurVaJdJl2PfmJgtydpqjvCub
/PEDT8nbLqs4l52a0JkpIWDcj7C6XAB9m+fVkEOT5jX25484DTJfDLVNuljCstkFu+2p
PMqB5CQBmcrMtKhgVFlaoD9ZHQv5EBkMADcNg=
MIME-Version: 1.0
In-Reply-To: <CAA2C=vCABbghMEVV2Hss+eXcmkFxuHA+dE6+Nc+-yzw-cHv1YA@mail.gmail.com>
References: <CAA2C=vCABbghMEVV2Hss+eXcmkFxuHA+dE6+Nc+-yzw-cHv1YA AT mail DOT gmail DOT com>
Date: Sun, 7 Aug 2011 15:19:22 +0300
Message-ID: <CAA2C=vBLXmFb9Pu7nmivBhiOGs=VghZ8f90CvcAk+ijV3+Cq+A@mail.gmail.com>
Subject: Re: [PATCH] fix cabs and cabsf build failure with gcc-4.4, test results
From: Ozkan Sezer <sezeroz AT gmail DOT com>
To: djgpp-workers AT delorie DOT com
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id p77CJQEh004956
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

PING.


On Sun, Jul 31, 2011 at 10:33 AM, Ozkan Sezer <sezeroz AT gmail DOT com> wrote:
> On Fri, Jul 1, 2011 at 9:32 PM, DJ Delorie <dj AT delorie DOT com> wrote:
>>
>> Hmmm... OK, I suppose.
>>
>> Can I assume you built and tested libm with your fix?  Does it return
>> the right values?
>>
>> We don't want to have to fix it twice...
>>
>
> I am moving this to a new thread because the old is, well, old
> and was long.
>
> The "conflicting types for built-in function 'cabs' and 'cabsf'" error
> is fixed by the following patch.  As for the requested test,  I looked
> at the mingw-w64 complex testsuite and butchered it to suit this
> (see attached mini tarball). The existing old and the suggested new
> versions output exactly the same failures (ran on an IBM PC DOS 7).
> Therefore the suggestion doesn't add any bugs.
>
> Please consider applying.
>
> Index: src/libm/math/w_cabs.c
> ===================================================================
> RCS file: /cvs/djgpp/djgpp/src/libm/math/w_cabs.c,v
> retrieving revision 1.3
> diff -u -p -r1.3 w_cabs.c
> --- src/libm/math/w_cabs.c      14 Dec 1999 12:01:34 -0000      1.3
> +++ src/libm/math/w_cabs.c      2 Jul 2011 08:33:01 -0000
> @@ -9,18 +9,8 @@
>
>  #include "fdlibm.h"
>
> -struct complex {
> -       double x;
> -       double y;
> -};
> -
> -#ifdef __STDC__
> -double cabs(struct complex);
> -double cabs(struct complex z)
> -#else
> -double cabs(z)
> -     struct complex z;
> -#endif
> +double cabs(double _Complex);
> +double cabs(double _Complex z)
>  {
> -       return hypot(z.x, z.y);
> +       return hypot(__real__ z, __imag__ z);
>  }
> Index: src/libm/math/wf_cabs.c
> ===================================================================
> RCS file: /cvs/djgpp/djgpp/src/libm/math/wf_cabs.c,v
> retrieving revision 1.3
> diff -u -p -r1.3 wf_cabs.c
> --- src/libm/math/wf_cabs.c     14 Dec 1999 12:01:34 -0000      1.3
> +++ src/libm/math/wf_cabs.c     2 Jul 2011 08:33:01 -0000
> @@ -9,18 +9,8 @@
>
>  #include "fdlibm.h"
>
> -struct complex {
> -       float x;
> -       float y;
> -};
> -
> -#ifdef __STDC__
> -float cabsf(struct complex);
> -float cabsf(struct complex z)
> -#else
> -float cabsf(z)
> -       struct complex z;
> -#endif
> +float cabsf(float _Complex);
> +float cabsf(float _Complex z)
>  {
> -       return hypotf(z.x, z.y);
> +       return hypotf(__real__ z, __imag__ z);
>  }
>
> --
> O.S.
>

- Raw text -


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