This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Re: GCC build failed for native with your patch on2003-07-05T00:22:37Z.
- From: "Zack Weinberg" <zack at codesourcery dot com>
- To: Andrew Pinski <pinskia at physics dot uc dot edu>
- Cc: gcc-regression at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Fri, 04 Jul 2003 23:59:10 -0700
- Subject: Re: [PATCH] Re: GCC build failed for native with your patch on2003-07-05T00:22:37Z.
- References: <412F4F80-AE8D-11D7-9AE0-000393A6D2F2@physics.uc.edu>
Andrew Pinski <pinskia@physics.uc.edu> writes:
> This is caused by Darwin not having iconv so iconv_t is defined in
> cpphash.h as int but is
> compared to size_t in convert_cset in cppcharset.c on line 217.
>
> There are two ways to fix this, either by changing iconv_t to be the
> same as size_t or
> change the comparison to be of type incov_t.
> Doing both is the safest.
Actually, neither of these is the right fix. The return type of iconv is
size_t. The problem is with the fallback macro.
The appended patch should at least get you farther.
zw
* cppcharset.c: Use the correct return type for the fallback
iconv macro.
===================================================================
Index: cppcharset.c
--- cppcharset.c 5 Jul 2003 00:23:47 -0000 1.5
+++ cppcharset.c 5 Jul 2003 06:58:12 -0000
@@ -79,7 +79,7 @@ Foundation, 59 Temple Place - Suite 330,
below, which are guarded only by if statements with compile-time
constant conditions, do not cause link errors. */
#define iconv_open(x, y) (errno = EINVAL, (iconv_t)-1)
-#define iconv(a,b,c,d,e) (errno = EINVAL, (iconv_t)-1)
+#define iconv(a,b,c,d,e) (errno = EINVAL, (size_t)-1)
#define iconv_close(x) 0
#endif