This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Re: GCC build failed for native with your patch on2003-07-05T00:22:37Z.


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
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]