[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

glibc-2.1 & string optimizations (fwd)



Shalom!

I just picked this up from the Sparc/Linux mailing list.  It seems like
this could also be a problem w/ Red Hat 5.0, which uses glibc.  Maybe
someone using RH 5.0 for development (Eli?) could see if this also affects
the Intel platforms, and post the findings back to the list?

Shabbat Shalom!

								Eliyahu

---------- Forwarded message ----------
Date: Fri, 9 Jan 1998 12:45:36 +0100 (CET)
From: Eric Delaunay <delaunay@lix.polytechnique.fr>
To: debian sparc group <debian-sparc@lists.debian.org>,
    linux-sparc mailing list <sparclinux@vger.rutgers.edu>
Subject: glibc-2.1 & string optimizations


  I discovered a problem with string optimizations in glibc 2.1 because each
str... function is overriden by a macro which uses its arguments multiple
times (see bits/string2.h).  For instance, you cannot write something like
	strcmp( *++argv, "foo" )
anymore.  However, many programs are based on such constructs :-(

In order to avoid this kind of bug when recompiling a program for glibc 2.1,
and since these macros extensively use GNU C extensions, I think they could be
rewritten either as inline functions or statements enclosed in parentheses to
evaluate their arguments no more than one time.

Any comments?

-- 
 Eric Delaunay                 | "La guerre justifie l'existence des militaires.
 delaunay@lix.polytechnique.fr | En les supprimant." Henri Jeanson (1900-1970)