1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/patches/glibc/2.3.3/glibc-2.3.2-allow-gcc-3.5-gconv.patch Thu Jul 12 08:47:15 2007 +0000
1.3 @@ -0,0 +1,228 @@
1.4 +Fixes
1.5 +gconv_open.c: In function `__gconv_open':
1.6 +gconv_open.c:186: error: invalid lvalue in assignment
1.7 +when building glibc-2.3.2 with gcc-3.5.
1.8 +
1.9 +wget 'http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/iconv/gconv_simple.c.diff?r1=1.59&r2=1.63&cvsroot=glibc'
1.10 + * (internal_ucs4_loop): Fix typo in last change.
1.11 +
1.12 + * (internal_ucs4le_loop): Remove cast used as lvalue.
1.13 +
1.14 + * Fix last commit.
1.15 +
1.16 + * iconv/gconv_simple.c (ucs4le_internal_loop): Remove cast used as lvalue.
1.17 + (internal_ucs4le_loop_single): Likewise.
1.18 + (ucs4_internal_loop): Likewise.
1.19 + (BODY): Likewise.
1.20 + (internal_ucs4_loop_single): Likewise.
1.21 +
1.22 +wget 'http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/iconv/gconv_open.c.diff?r1=1.32&r2=1.33&cvsroot=glibc'
1.23 + * iconv/gconv_simple.c (ucs4le_internal_loop): Remove cast used as lvalue.
1.24 + (internal_ucs4le_loop_single): Likewise.
1.25 + (ucs4_internal_loop): Likewise.
1.26 + (BODY): Likewise.
1.27 + (internal_ucs4_loop_single): Likewise.
1.28 +
1.29 +
1.30 +===================================================================
1.31 +RCS file: /cvs/glibc/libc/iconv/gconv_open.c,v
1.32 +retrieving revision 1.32
1.33 +retrieving revision 1.33
1.34 +diff -u -r1.32 -r1.33
1.35 +--- libc/iconv/gconv_open.c 2001/11/29 04:51:58 1.32
1.36 ++++ libc/iconv/gconv_open.c 2004/02/07 15:56:32 1.33
1.37 +@@ -1,5 +1,5 @@
1.38 + /* Find matching transformation algorithms and initialize steps.
1.39 +- Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
1.40 ++ Copyright (C) 1997, 1998, 1999, 2000, 2001, 2004 Free Software Foundation, Inc.
1.41 + This file is part of the GNU C Library.
1.42 + Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
1.43 +
1.44 +@@ -182,8 +182,13 @@
1.45 + || __builtin_expect (__gconv_translit_find (runp), 0) == 0)
1.46 + lastp = runp;
1.47 + else
1.48 +- /* This means we haven't found the module. Remove it. */
1.49 +- (lastp == NULL ? trans : lastp->next) = runp->next;
1.50 ++ {
1.51 ++ /* This means we haven't found the module. Remove it. */
1.52 ++ if (lastp == NULL)
1.53 ++ trans = runp->next;
1.54 ++ else
1.55 ++ lastp->next = runp->next;
1.56 ++ }
1.57 + }
1.58 +
1.59 + /* Allocate room for handle. */
1.60 +===================================================================
1.61 +RCS file: /cvs/glibc/libc/iconv/gconv_simple.c,v
1.62 +retrieving revision 1.59
1.63 +retrieving revision 1.63
1.64 +diff -u -r1.59 -r1.63
1.65 +--- libc/iconv/gconv_simple.c 2003/06/11 21:36:37 1.59
1.66 ++++ libc/iconv/gconv_simple.c 2004/03/09 10:00:31 1.63
1.67 +@@ -1,5 +1,5 @@
1.68 + /* Simple transformations functions.
1.69 +- Copyright (C) 1997-2002, 2003 Free Software Foundation, Inc.
1.70 ++ Copyright (C) 1997-2003, 2004 Free Software Foundation, Inc.
1.71 + This file is part of the GNU C Library.
1.72 + Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
1.73 +
1.74 +@@ -87,12 +87,13 @@
1.75 + #if __BYTE_ORDER == __LITTLE_ENDIAN
1.76 + /* Sigh, we have to do some real work. */
1.77 + size_t cnt;
1.78 ++ uint32_t *outptr32 = (uint32_t *) outptr;
1.79 +
1.80 + for (cnt = 0; cnt < n_convert; ++cnt, inptr += 4)
1.81 +- *((uint32_t *) outptr)++ = bswap_32 (*(const uint32_t *) inptr);
1.82 ++ *outptr32++ = bswap_32 (*(const uint32_t *) inptr);
1.83 +
1.84 + *inptrp = inptr;
1.85 +- *outptrp = outptr;
1.86 ++ *outptrp = (unsigned char *) outptr32;
1.87 + #elif __BYTE_ORDER == __BIG_ENDIAN
1.88 + /* Simply copy the data. */
1.89 + *inptrp = inptr + n_convert * 4;
1.90 +@@ -192,13 +193,16 @@
1.91 + (*outptrp)[2] = state->__value.__wchb[1];
1.92 + (*outptrp)[3] = state->__value.__wchb[0];
1.93 +
1.94 +- *outptrp += 4;
1.95 + #elif __BYTE_ORDER == __BIG_ENDIAN
1.96 + /* XXX unaligned */
1.97 +- *(*((uint32_t **) outptrp)++) = state->__value.__wch;
1.98 ++ (*outptrp)[0] = state->__value.__wchb[0];
1.99 ++ (*outptrp)[1] = state->__value.__wchb[1];
1.100 ++ (*outptrp)[2] = state->__value.__wchb[2];
1.101 ++ (*outptrp)[3] = state->__value.__wchb[3];
1.102 + #else
1.103 + # error "This endianess is not supported."
1.104 + #endif
1.105 ++ *outptrp += 4;
1.106 +
1.107 + /* Clear the state buffer. */
1.108 + state->__count &= ~7;
1.109 +@@ -268,7 +272,8 @@
1.110 + return __GCONV_ILLEGAL_INPUT;
1.111 + }
1.112 +
1.113 +- *((uint32_t *) outptr)++ = inval;
1.114 ++ *((uint32_t *) outptr) = inval;
1.115 ++ outptr += sizeof (uint32_t);
1.116 + }
1.117 +
1.118 + *inptrp = inptr;
1.119 +@@ -447,9 +452,11 @@
1.120 + #if __BYTE_ORDER == __BIG_ENDIAN
1.121 + /* Sigh, we have to do some real work. */
1.122 + size_t cnt;
1.123 ++ uint32_t *outptr32 = (uint32_t *) outptr;
1.124 +
1.125 + for (cnt = 0; cnt < n_convert; ++cnt, inptr += 4)
1.126 +- *((uint32_t *) outptr)++ = bswap_32 (*(const uint32_t *) inptr);
1.127 ++ *outptr32++ = bswap_32 (*(const uint32_t *) inptr);
1.128 ++ outptr = (unsigned char *) outptr32;
1.129 +
1.130 + *inptrp = inptr;
1.131 + *outptrp = outptr;
1.132 +@@ -555,12 +562,17 @@
1.133 + (*outptrp)[2] = state->__value.__wchb[1];
1.134 + (*outptrp)[3] = state->__value.__wchb[0];
1.135 +
1.136 +- *outptrp += 4;
1.137 + #else
1.138 + /* XXX unaligned */
1.139 +- *(*((uint32_t **) outptrp)++) = state->__value.__wch;
1.140 ++ (*outptrp)[0] = state->__value.__wchb[0];
1.141 ++ (*outptrp)[1] = state->__value.__wchb[1];
1.142 ++ (*outptrp)[2] = state->__value.__wchb[2];
1.143 ++ (*outptrp)[3] = state->__value.__wchb[3];
1.144 ++
1.145 + #endif
1.146 +
1.147 ++ *outptrp += 4;
1.148 ++
1.149 + /* Clear the state buffer. */
1.150 + state->__count &= ~7;
1.151 +
1.152 +@@ -626,7 +638,8 @@
1.153 + return __GCONV_ILLEGAL_INPUT;
1.154 + }
1.155 +
1.156 +- *((uint32_t *) outptr)++ = inval;
1.157 ++ *((uint32_t *) outptr) = inval;
1.158 ++ outptr += sizeof (uint32_t);
1.159 + }
1.160 +
1.161 + *inptrp = inptr;
1.162 +@@ -808,7 +821,8 @@
1.163 + } \
1.164 + else \
1.165 + /* It's an one byte sequence. */ \
1.166 +- *((uint32_t *) outptr)++ = *inptr++; \
1.167 ++ *((uint32_t *) outptr) = *inptr++; \
1.168 ++ outptr += sizeof (uint32_t); \
1.169 + }
1.170 + #define LOOP_NEED_FLAGS
1.171 + #include <iconv/loop.c>
1.172 +@@ -838,7 +852,8 @@
1.173 + } \
1.174 + else \
1.175 + /* It's an one byte sequence. */ \
1.176 +- *outptr++ = *((const uint32_t *) inptr)++; \
1.177 ++ *outptr++ = *((const uint32_t *) inptr); \
1.178 ++ inptr += sizeof (uint32_t); \
1.179 + }
1.180 + #define LOOP_NEED_FLAGS
1.181 + #include <iconv/loop.c>
1.182 +@@ -1032,7 +1047,8 @@
1.183 + } \
1.184 + \
1.185 + /* Now adjust the pointers and store the result. */ \
1.186 +- *((uint32_t *) outptr)++ = ch; \
1.187 ++ *((uint32_t *) outptr) = ch; \
1.188 ++ outptr += sizeof (uint32_t); \
1.189 + }
1.190 + #define LOOP_NEED_FLAGS
1.191 +
1.192 +@@ -1153,7 +1169,8 @@
1.193 + STANDARD_FROM_LOOP_ERR_HANDLER (2); \
1.194 + } \
1.195 + \
1.196 +- *((uint32_t *) outptr)++ = u1; \
1.197 ++ *((uint32_t *) outptr) = u1; \
1.198 ++ outptr += sizeof (uint32_t); \
1.199 + inptr += 2; \
1.200 + }
1.201 + #define LOOP_NEED_FLAGS
1.202 +@@ -1201,7 +1218,8 @@
1.203 + } \
1.204 + else \
1.205 + { \
1.206 +- *((uint16_t *) outptr)++ = val; \
1.207 ++ *((uint16_t *) outptr) = val; \
1.208 ++ outptr += sizeof (uint16_t); \
1.209 + inptr += 4; \
1.210 + } \
1.211 + }
1.212 +@@ -1242,7 +1260,8 @@
1.213 + continue; \
1.214 + } \
1.215 + \
1.216 +- *((uint32_t *) outptr)++ = u1; \
1.217 ++ *((uint32_t *) outptr) = u1; \
1.218 ++ outptr += sizeof (uint32_t); \
1.219 + inptr += 2; \
1.220 + }
1.221 + #define LOOP_NEED_FLAGS
1.222 +@@ -1291,7 +1310,8 @@
1.223 + } \
1.224 + else \
1.225 + { \
1.226 +- *((uint16_t *) outptr)++ = bswap_16 (val); \
1.227 ++ *((uint16_t *) outptr) = bswap_16 (val); \
1.228 ++ outptr += sizeof (uint16_t); \
1.229 + inptr += 4; \
1.230 + } \
1.231 + }