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: References: Date: Sun, 7 Aug 2011 15:19:22 +0300 Message-ID: Subject: Re: [PATCH] fix cabs and cabsf build failure with gcc-4.4, test results From: Ozkan Sezer To: djgpp-workers AT delorie DOT com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit 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 Precedence: bulk PING. On Sun, Jul 31, 2011 at 10:33 AM, Ozkan Sezer wrote: > On Fri, Jul 1, 2011 at 9:32 PM, DJ Delorie 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. >