linux-gcc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* glibc 2.3.1: fix for the i386 inline strings code
@ 2003-01-06  1:30 Denis Zaitsev
       [not found] ` <u8u1gm7fwy.fsf@gromit.moeb>
  2003-01-14  6:43 ` Ulrich Drepper
  0 siblings, 2 replies; 5+ messages in thread
From: Denis Zaitsev @ 2003-01-06  1:30 UTC (permalink / raw)
  To: Ulrich Drepper, Andreas Jaeger; +Cc: libc-alpha, linux-gcc

Nobody has answered to me for a while, so I'm resending this
politely...

This is a trivial patch for the inlined i386 strings' header.  Without
it, say, X11 can't be compiled with -D__USE_STRING_INLINES - a
problems will be caused by XtNewString and X11's own bzero.  These
problems are cured by the first and the second chunks of the patch,
correspondingly.

So, please, apply this.


--- sysdeps/i386/i486/bits/string.h.orig	Fri Jan  3 12:17:55 2003
+++ sysdeps/i386/i486/bits/string.h	Sat Jan  4 06:04:08 2003
@@ -40,10 +40,10 @@
 
 /* The macros are used in some of the optimized implementations below.  */
 #define __STRING_SMALL_GET16(src, idx) \
-  (((src)[idx + 1] << 8) | (src)[idx])
+  ((((char*)(src))[idx + 1] << 8) | ((char*)(src))[idx])
 #define __STRING_SMALL_GET32(src, idx) \
-  ((((src)[idx + 3] << 8 | (src)[idx + 2]) << 8				      \
-    | (src)[idx + 1]) << 8 | (src)[idx])
+  (((((char*)(src))[idx + 3] << 8 | ((char*)(src))[idx + 2]) << 8	      \
+    | ((char*)(src))[idx + 1]) << 8 | ((char*)(src))[idx])
 
 
 /* Copy N bytes of SRC to DEST.  */
@@ -229,7 +229,7 @@ memcmp (__const void *__s1, __const void
 	assignments using immediate operands.  But this uses to much	      \
 	memory (7, instead of 4 bytes).  So we force the value in a	      \
 	registers.  */							      \
-     if (n == 3 || n >= 5)						      \
+     if ((n) == 3 || (n) >= 5)						      \
        __asm__ __volatile__ ("" : "=r" (__c) : "0" (__c));		      \
 									      \
      /* This `switch' statement will be removed at compile-time.  */	      \

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-01-14  6:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-06  1:30 glibc 2.3.1: fix for the i386 inline strings code Denis Zaitsev
     [not found] ` <u8u1gm7fwy.fsf@gromit.moeb>
2003-01-07  3:43   ` Denis Zaitsev
2003-01-07 18:40     ` Michael Riepe
2003-01-08  5:35       ` Denis Zaitsev
2003-01-14  6:43 ` Ulrich Drepper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).