This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: glibc 2.3.1: fix for the i386 inline strings code
- From: Andreas Jaeger <aj at suse dot de>
- To: Denis Zaitsev <zzz at cd-club dot ru>
- Cc: Ulrich Drepper <drepper at redhat dot com>,libc-alpha at sources dot redhat dot com
- Date: Mon, 06 Jan 2003 11:04:29 +0100
- Subject: Re: glibc 2.3.1: fix for the i386 inline strings code
- References: <20030106063048.A32392@natasha.zzz.zzz>
Denis Zaitsev <zzz@cd-club.ru> writes:
> 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
What exactly is the problem with X11?
Andreas
> 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. */ \
>
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.inka.de
http://www.suse.de/~aj