patches/glibc/2.3.3/glibc-2.3.2-allow-gcc-3.5-gconv.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sat Feb 24 11:00:05 2007 +0000 (2007-02-24)
changeset 1 eeea35fbf182
permissions -rw-r--r--
Add the full crosstool-NG sources to the new repository of its own.
You might just say: 'Yeah! crosstool-NG's got its own repo!".
Unfortunately, that's because the previous repo got damaged beyond repair and I had no backup.
That means I'm putting backups in place in the afternoon.
That also means we've lost history... :-(
     1 Fixes
     2 gconv_open.c: In function `__gconv_open':
     3 gconv_open.c:186: error: invalid lvalue in assignment
     4 when building glibc-2.3.2 with gcc-3.5.
     5 
     6 wget 'http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/iconv/gconv_simple.c.diff?r1=1.59&r2=1.63&cvsroot=glibc'
     7         * (internal_ucs4_loop): Fix typo in last change.
     8 
     9         * (internal_ucs4le_loop): Remove cast used as lvalue.
    10 
    11         * Fix last commit.
    12 
    13 	* iconv/gconv_simple.c (ucs4le_internal_loop): Remove cast used as lvalue.
    14 	(internal_ucs4le_loop_single): Likewise.
    15 	(ucs4_internal_loop): Likewise.
    16 	(BODY): Likewise.
    17 	(internal_ucs4_loop_single): Likewise.
    18 
    19 wget 'http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/iconv/gconv_open.c.diff?r1=1.32&r2=1.33&cvsroot=glibc'
    20 	* iconv/gconv_simple.c (ucs4le_internal_loop): Remove cast used as lvalue.
    21 	(internal_ucs4le_loop_single): Likewise.
    22 	(ucs4_internal_loop): Likewise.
    23 	(BODY): Likewise.
    24 	(internal_ucs4_loop_single): Likewise.
    25 
    26 
    27 ===================================================================
    28 RCS file: /cvs/glibc/libc/iconv/gconv_open.c,v
    29 retrieving revision 1.32
    30 retrieving revision 1.33
    31 diff -u -r1.32 -r1.33
    32 --- libc/iconv/gconv_open.c	2001/11/29 04:51:58	1.32
    33 +++ libc/iconv/gconv_open.c	2004/02/07 15:56:32	1.33
    34 @@ -1,5 +1,5 @@
    35  /* Find matching transformation algorithms and initialize steps.
    36 -   Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
    37 +   Copyright (C) 1997, 1998, 1999, 2000, 2001, 2004 Free Software Foundation, Inc.
    38     This file is part of the GNU C Library.
    39     Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
    40  
    41 @@ -182,8 +182,13 @@
    42  	      || __builtin_expect (__gconv_translit_find (runp), 0) == 0)
    43  	    lastp = runp;
    44  	  else
    45 -	    /* This means we haven't found the module.  Remove it.  */
    46 -	    (lastp == NULL ? trans : lastp->next) = runp->next;
    47 +	    {
    48 +	      /* This means we haven't found the module.  Remove it.  */
    49 +	      if (lastp == NULL)
    50 +		trans  = runp->next;
    51 +	      else
    52 +		lastp->next  = runp->next;
    53 +	    }
    54  	}
    55  
    56        /* Allocate room for handle.  */
    57 ===================================================================
    58 RCS file: /cvs/glibc/libc/iconv/gconv_simple.c,v
    59 retrieving revision 1.59
    60 retrieving revision 1.63
    61 diff -u -r1.59 -r1.63
    62 --- libc/iconv/gconv_simple.c	2003/06/11 21:36:37	1.59
    63 +++ libc/iconv/gconv_simple.c	2004/03/09 10:00:31	1.63
    64 @@ -1,5 +1,5 @@
    65  /* Simple transformations functions.
    66 -   Copyright (C) 1997-2002, 2003 Free Software Foundation, Inc.
    67 +   Copyright (C) 1997-2003, 2004 Free Software Foundation, Inc.
    68     This file is part of the GNU C Library.
    69     Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
    70  
    71 @@ -87,12 +87,13 @@
    72  #if __BYTE_ORDER == __LITTLE_ENDIAN
    73    /* Sigh, we have to do some real work.  */
    74    size_t cnt;
    75 +  uint32_t *outptr32 = (uint32_t *) outptr;
    76  
    77    for (cnt = 0; cnt < n_convert; ++cnt, inptr += 4)
    78 -    *((uint32_t *) outptr)++ = bswap_32 (*(const uint32_t *) inptr);
    79 +    *outptr32++ = bswap_32 (*(const uint32_t *) inptr);
    80  
    81    *inptrp = inptr;
    82 -  *outptrp = outptr;
    83 +  *outptrp = (unsigned char *) outptr32;
    84  #elif __BYTE_ORDER == __BIG_ENDIAN
    85    /* Simply copy the data.  */
    86    *inptrp = inptr + n_convert * 4;
    87 @@ -192,13 +193,16 @@
    88    (*outptrp)[2] = state->__value.__wchb[1];
    89    (*outptrp)[3] = state->__value.__wchb[0];
    90  
    91 -  *outptrp += 4;
    92  #elif __BYTE_ORDER == __BIG_ENDIAN
    93    /* XXX unaligned */
    94 -  *(*((uint32_t **) outptrp)++) = state->__value.__wch;
    95 +  (*outptrp)[0] = state->__value.__wchb[0];
    96 +  (*outptrp)[1] = state->__value.__wchb[1];
    97 +  (*outptrp)[2] = state->__value.__wchb[2];
    98 +  (*outptrp)[3] = state->__value.__wchb[3];
    99  #else
   100  # error "This endianess is not supported."
   101  #endif
   102 +  *outptrp += 4;
   103  
   104    /* Clear the state buffer.  */
   105    state->__count &= ~7;
   106 @@ -268,7 +272,8 @@
   107  	  return __GCONV_ILLEGAL_INPUT;
   108  	}
   109  
   110 -      *((uint32_t *) outptr)++ = inval;
   111 +      *((uint32_t *) outptr) = inval;
   112 +      outptr += sizeof (uint32_t);
   113      }
   114  
   115    *inptrp = inptr;
   116 @@ -447,9 +452,11 @@
   117  #if __BYTE_ORDER == __BIG_ENDIAN
   118    /* Sigh, we have to do some real work.  */
   119    size_t cnt;
   120 +  uint32_t *outptr32 = (uint32_t *) outptr;
   121  
   122    for (cnt = 0; cnt < n_convert; ++cnt, inptr += 4)
   123 -    *((uint32_t *) outptr)++ = bswap_32 (*(const uint32_t *) inptr);
   124 +    *outptr32++ = bswap_32 (*(const uint32_t *) inptr);
   125 +  outptr = (unsigned char *) outptr32;
   126  
   127    *inptrp = inptr;
   128    *outptrp = outptr;
   129 @@ -555,12 +562,17 @@
   130    (*outptrp)[2] = state->__value.__wchb[1];
   131    (*outptrp)[3] = state->__value.__wchb[0];
   132  
   133 -  *outptrp += 4;
   134  #else
   135    /* XXX unaligned */
   136 -  *(*((uint32_t **) outptrp)++) = state->__value.__wch;
   137 +  (*outptrp)[0] = state->__value.__wchb[0];
   138 +  (*outptrp)[1] = state->__value.__wchb[1];
   139 +  (*outptrp)[2] = state->__value.__wchb[2];
   140 +  (*outptrp)[3] = state->__value.__wchb[3];
   141 +
   142  #endif
   143  
   144 +  *outptrp += 4;
   145 +
   146    /* Clear the state buffer.  */
   147    state->__count &= ~7;
   148  
   149 @@ -626,7 +638,8 @@
   150  	  return __GCONV_ILLEGAL_INPUT;
   151  	}
   152  
   153 -      *((uint32_t *) outptr)++ = inval;
   154 +      *((uint32_t *) outptr) = inval;
   155 +      outptr += sizeof (uint32_t);
   156      }
   157  
   158    *inptrp = inptr;
   159 @@ -808,7 +821,8 @@
   160        }									      \
   161      else								      \
   162        /* It's an one byte sequence.  */					      \
   163 -      *((uint32_t *) outptr)++ = *inptr++;				      \
   164 +      *((uint32_t *) outptr) = *inptr++;				      \
   165 +      outptr += sizeof (uint32_t);					      \
   166    }
   167  #define LOOP_NEED_FLAGS
   168  #include <iconv/loop.c>
   169 @@ -838,7 +852,8 @@
   170        }									      \
   171      else								      \
   172        /* It's an one byte sequence.  */					      \
   173 -      *outptr++ = *((const uint32_t *) inptr)++;			      \
   174 +      *outptr++ = *((const uint32_t *) inptr);				      \
   175 +      inptr += sizeof (uint32_t);					      \
   176    }
   177  #define LOOP_NEED_FLAGS
   178  #include <iconv/loop.c>
   179 @@ -1032,7 +1047,8 @@
   180        }									      \
   181  									      \
   182      /* Now adjust the pointers and store the result.  */		      \
   183 -    *((uint32_t *) outptr)++ = ch;					      \
   184 +    *((uint32_t *) outptr) = ch;					      \
   185 +    outptr += sizeof (uint32_t);					      \
   186    }
   187  #define LOOP_NEED_FLAGS
   188  
   189 @@ -1153,7 +1169,8 @@
   190  	STANDARD_FROM_LOOP_ERR_HANDLER (2);				      \
   191        }									      \
   192  									      \
   193 -    *((uint32_t *) outptr)++ = u1;					      \
   194 +    *((uint32_t *) outptr) = u1;					      \
   195 +    outptr += sizeof (uint32_t);					      \
   196      inptr += 2;								      \
   197    }
   198  #define LOOP_NEED_FLAGS
   199 @@ -1201,7 +1218,8 @@
   200        }									      \
   201      else								      \
   202        {									      \
   203 -	*((uint16_t *) outptr)++ = val;					      \
   204 +	*((uint16_t *) outptr) = val;					      \
   205 +        outptr += sizeof (uint16_t);					      \
   206  	inptr += 4;							      \
   207        }									      \
   208    }
   209 @@ -1242,7 +1260,8 @@
   210  	continue;							      \
   211        }									      \
   212  									      \
   213 -    *((uint32_t *) outptr)++ = u1;					      \
   214 +    *((uint32_t *) outptr) = u1;					      \
   215 +    outptr += sizeof (uint32_t);					      \
   216      inptr += 2;								      \
   217    }
   218  #define LOOP_NEED_FLAGS
   219 @@ -1291,7 +1310,8 @@
   220        }									      \
   221      else								      \
   222        {									      \
   223 -	*((uint16_t *) outptr)++ = bswap_16 (val);			      \
   224 +	*((uint16_t *) outptr) = bswap_16 (val);			      \
   225 +	outptr += sizeof (uint16_t);					      \
   226  	inptr += 4;							      \
   227        }									      \
   228    }