X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f X-Recipient: djgpp-workers AT delorie DOT com Date: Sat, 20 Aug 2011 15:52:58 +0300 From: Eli Zaretskii Subject: Re: [PATCH] fix cabs and cabsf build failure with gcc-4.4, test results In-reply-to: X-012-Sender: halo1 AT inter DOT net DOT il To: djgpp-workers AT delorie DOT com Message-id: <83ty9c453p.fsf@gnu.org> References: 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 > Date: Sat, 20 Aug 2011 14:26:18 +0300 > From: Ozkan Sezer > > 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. Thanks again for your work on this. 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); }