delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2011/08/20/12:21:38

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=LAxWx+kZevvvHsQ2E2POFfJGvsllFV2Q/MuhkjFaFks=;
b=XbXxT0asa8K9th4/7GsgKgvolpJAAdleB3FtzC0o+EdWjOCNtjqYVuWdfUKZd8xAiq
7OdxUdp7sUxazsBEyIoCQsldr9lQtOsxA4eTGfv9C7lKYldXCFJx4SD0nM+FaZbSpY50
cza8UBlOiw9EDn1303+AI0TC2hcEqOcabnIVA=
MIME-Version: 1.0
In-Reply-To: <83ty9c453p.fsf@gnu.org>
References: <CAA2C=vCABbghMEVV2Hss+eXcmkFxuHA+dE6+Nc+-yzw-cHv1YA AT mail DOT gmail DOT com>
<CAA2C=vBLXmFb9Pu7nmivBhiOGs=VghZ8f90CvcAk+ijV3+Cq+A AT mail DOT gmail DOT com>
<CAA2C=vAjAgCxQqu1bJGE05Rbjd+6b7z_2xKZ=YHYfsKr5uKptQ AT mail DOT gmail DOT com>
<83ty9c453p DOT fsf AT gnu DOT org>
Date: Sat, 20 Aug 2011 19:21:24 +0300
Message-ID: <CAA2C=vAugou6EnTE3hkTHOM9_vOhzbmRc6eNfjGPj5bptwpuTg@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 p7KGLT13026079
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

On Sat, Aug 20, 2011 at 3:52 PM, Eli Zaretskii <eliz AT gnu DOT org> wrote:
>> Date: Sat, 20 Aug 2011 14:26:18 +0300
>> From: Ozkan Sezer <sezeroz AT gmail DOT com>
>>
>> PING^2
>
> Sorry for the delay.  I applied the patch now, with 3 changes:
>
>  . I added a Copyright year to each file to indicate a change in the
>   year 2011.
>
>  . I used "_Complex double" and "_Complex float" in the declarations,
>   not "double _Complex" etc., as the GCC manual seems to suggest the
>   former.
>
>  . I didn't remove the K&R prototypes, and instead modified them to
>   fit the STDC ones.
>
> The patch I committed appears below.  Please see if I didn't screw up
> anything.
>

AFAICS, seems OK and compiles.

> Thanks again for your work on this.
>

My pleasure.


> Index: src/libm/math/w_cabs.c
> ===================================================================
> RCS file: /cvs/djgpp/djgpp/src/libm/math/w_cabs.c,v
> retrieving revision 1.3
> retrieving revision 1.4
> diff -u -r1.3 -r1.4
> --- src/libm/math/w_cabs.c      14 Dec 1999 12:01:34 -0000      1.3
> +++ src/libm/math/w_cabs.c      20 Aug 2011 12:41:02 -0000      1.4
> @@ -1,3 +1,4 @@
> +/* Copyright (C) 2011 DJ Delorie, see COPYING.DJ for details */
>  /* Copyright (C) 1999 DJ Delorie, see COPYING.DJ for details */
>  /* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
>  /*
> @@ -9,18 +10,13 @@
>
>  #include "fdlibm.h"
>
> -struct complex {
> -       double x;
> -       double y;
> -};
> -
>  #ifdef __STDC__
> -double cabs(struct complex);
> -double cabs(struct complex z)
> +double cabs(_Complex double);
> +double cabs(_Complex double z)
>  #else
>  double cabs(z)
> -     struct complex z;
> +     _Complex double z;
>  #endif
>  {
> -       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
> retrieving revision 1.4
> diff -u -r1.3 -r1.4
> --- src/libm/math/wf_cabs.c     14 Dec 1999 12:01:34 -0000      1.3
> +++ src/libm/math/wf_cabs.c     20 Aug 2011 12:41:02 -0000      1.4
> @@ -1,3 +1,4 @@
> +/* Copyright (C) 2011 DJ Delorie, see COPYING.DJ for details */
>  /* Copyright (C) 1999 DJ Delorie, see COPYING.DJ for details */
>  /* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
>  /*
> @@ -9,18 +10,13 @@
>
>  #include "fdlibm.h"
>
> -struct complex {
> -       float x;
> -       float y;
> -};
> -
>  #ifdef __STDC__
> -float cabsf(struct complex);
> -float cabsf(struct complex z)
> +float cabsf(_Complex float);
> +float cabsf(_Complex float z)
>  #else
>  float cabsf(z)
> -       struct complex z;
> +       _Complex float z;
>  #endif
>  {
> -       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