delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2011/07/01/13:33:49

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=kdvgejM5ZZHJHGqpChtQhUDvvDwgcuABGkPKtChQx+U=;
b=ANCMSvQUCR9rlEiw0eSTmSE6aQdJt8ab53kW4iQybECreL/QuAqPz5Lg6Cd8X3barH
PYhfjQzfamY5slAr7IpbuU9/4qUTy+mzRECpCr/WXQAL9DeoTZ5KYFT5gG+YkzPttJNu
cLNWuPUihx5wBKfgCkE/6NIOhMm7rEYh9K/Is=
MIME-Version: 1.0
In-Reply-To: <BANLkTinPMEVyiceCG5QEjRDsTwqWqfUuGg@mail.gmail.com>
References: <BANLkTikW3CVu0QEHyFwgfpvzqNoMR6Tfrg AT mail DOT gmail DOT com>
<83tyb6qce3 DOT fsf AT gnu DOT org>
<BANLkTi=q_JbhptgWTi8ZN7mtq9NO9zPX0g AT mail DOT gmail DOT com>
<201107011526 DOT p61FQs24012782 AT envy DOT delorie DOT com>
<BANLkTi=BU4UzOR+RtD9hJRCtKq6eR3AYog AT mail DOT gmail DOT com>
<201107011539 DOT p61FdYjI013658 AT envy DOT delorie DOT com>
<BANLkTi=HfCnAD4WUndyU_bdnP6wXuOPo0A AT mail DOT gmail DOT com>
<201107011548 DOT p61FmWQW014052 AT envy DOT delorie DOT com>
<BANLkTinA0i1sOT4tM4igv6Y1aR+3vdnNJg AT mail DOT gmail DOT com>
<201107011557 DOT p61FvXVP014582 AT envy DOT delorie DOT com>
<BANLkTim-07ErkunBix8U46KYFF497HKAPA AT mail DOT gmail DOT com>
<201107011614 DOT p61GEu8r015173 AT envy DOT delorie DOT com>
<4E0DFC80 DOT 2070607 AT iki DOT fi>
<BANLkTinPMEVyiceCG5QEjRDsTwqWqfUuGg AT mail DOT gmail DOT com>
Date: Fri, 1 Jul 2011 20:33:18 +0300
Message-ID: <BANLkTi=+dUg8py11+BweccQtUdum1pxApA@mail.gmail.com>
Subject: Re: gcc-4.4: conflicting types for built-in function 'cabs' and 'cabsf'
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 p61HXOgs026540
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 Fri, Jul 1, 2011 at 8:10 PM, Ozkan Sezer <sezeroz AT gmail DOT com> wrote:
> On Fri, Jul 1, 2011 at 7:57 PM, Andris Pavenis <andris DOT pavenis AT iki DOT fi> wrote:
>> On 07/01/2011 07:14 PM, DJ Delorie wrote:
>>>
>>> Could you check the other prototypes too, and see if any othes aren't
>>> needed?
>>>
>>> Maybe we should just comment them out for now, in case someone wants
>>> to add them back in later, with a comment about this discussion...
>>
>> From build directory of gcc-4.6.1 for DJGPP v2.04:
>>
>> [andris AT ap2 .libs]$ i586-pc-msdosdjgpp-nm libgfortran.a | grep cabs
>>         U _cabs
>>         U _cabsf
>>         U _cabsf
>>         U _cabs
>>         U _cabsf
>>
>
>
> Ah, sorry that I missed that
>
>
>> Removal would break FORTRAN support.
>>
>
>
> Then building them should be fixed.
>

Possibly something like the following:

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	1 Jul 2011 17:22:50 -0000
@@ -15,12 +15,14 @@ struct complex {
 };

 #ifdef __STDC__
-double cabs(struct complex);
-double cabs(struct complex z)
+double __dj_cabs(struct complex);
+double __dj_cabs(struct complex z)
 #else
-double cabs(z)
+double __dj_cabs(z)
      struct complex z;
 #endif
 {
 	return hypot(z.x, z.y);
 }
+
+double __attribute__ ((alias ("__dj_cabs"))) cabs (double _Complex);
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	1 Jul 2011 17:22:50 -0000
@@ -15,12 +15,14 @@ struct complex {
 };

 #ifdef __STDC__
-float cabsf(struct complex);
-float cabsf(struct complex z)
+float __dj_cabsf(struct complex);
+float __dj_cabsf(struct complex z)
 #else
-float cabsf(z)
+float __dj_cabsf(z)
 	struct complex z;
 #endif
 {
 	return hypotf(z.x, z.y);
 }
+
+float __attribute__ ((alias ("__dj_cabsf"))) cabsf (float _Complex);

Yes, I know that this needs ifdefs against several gcc versions.
(I can't remember when gcc started providing complex builtins..)

--
O.S.

- Raw text -


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