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; bh=314Exly2VanS0vkhRFOV3lJTMtmDw4HSjFMpvUX+B1g=; b=jJwMJdTQPcSJRyZf4WWCC46EmxzpdYzL3zMJJ/Sbbl4yDQcy8H2WlKYz/fIwusYv+p FoJKWFlqCs0dp2yBa04Y1FuFrdgaAeZSpEGVA5tf1c5MnL+Cfbzdd7OR/Z/APpsKVUUR 2hCA6AY0vhCm70VVrsECxeSQIAjFj/1KP/w7U= MIME-Version: 1.0 In-Reply-To: <201107011753.p61Hr3XO020234@envy.delorie.com> References: <83tyb6qce3 DOT fsf AT gnu DOT org> <201107011526 DOT p61FQs24012782 AT envy DOT delorie DOT com> <201107011539 DOT p61FdYjI013658 AT envy DOT delorie DOT com> <201107011548 DOT p61FmWQW014052 AT envy DOT delorie DOT com> <201107011557 DOT p61FvXVP014582 AT envy DOT delorie DOT com> <201107011614 DOT p61GEu8r015173 AT envy DOT delorie DOT com> <4E0DFC80 DOT 2070607 AT iki DOT fi> <201107011734 DOT p61HYlRK019374 AT envy DOT delorie DOT com> <201107011753 DOT p61Hr3XO020234 AT envy DOT delorie DOT com> Date: Fri, 1 Jul 2011 21:12:15 +0300 Message-ID: Subject: Re: gcc-4.4: conflicting types for built-in function 'cabs' and 'cabsf' From: Ozkan Sezer To: djgpp-workers AT delorie DOT com Content-Type: text/plain; charset=ISO-8859-1 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 On Fri, Jul 1, 2011 at 8:53 PM, DJ Delorie wrote: > >> Old gcc? > > Do we really want to support gcc older than 2.95 ? > I guess not. Quick'n'dirty patch below. Tested comqilation using gcc-3.3.6 and 4.4.7. (Can't test anything older than 3.3 at the moment.) If OK, use it and abuse it. Index: 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 --- w_cabs.c 14 Dec 1999 12:01:34 -0000 1.3 +++ w_cabs.c 1 Jul 2011 18:01:44 -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: 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 --- wf_cabs.c 14 Dec 1999 12:01:34 -0000 1.3 +++ wf_cabs.c 1 Jul 2011 18:01:44 -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.