glibc 2.3.1: fix for the i386 inline strings code

Roland McGrath roland@redhat.com
Tue Jan 7 07:37:00 GMT 2003


The lack of parens around macro arguments was rampant in
sysdeps/i386/i486/bits/string.h, and I fixed that.  

I've also added a test case to string/tester.c that is perfectly valid C
(using void *) but barfs in the inline case, as you cited.

The problems stem from all these "sizeof((s)[0]) == 1" expressions in the
__builtin_constant_p-true branch of the macros.  This appears frequently,
and it makes no sense to me.  If the macro has correct function-like
behavior, the arguments in question are all already cast to char * (or
const char *), and so the test is always true.  I can't figure what it was
intended for.



More information about the Libc-alpha mailing list