Bug in glibc-2.1 for Sparc
Hi. I've discovered a nasty bug in glibc 2.1: arguments to
strcmp() (and possibly other functions) are evaluated more than once:
$ cat kk.c
#include <stdio.h>
#include <string.h>
static char * kk(void)
{
printf("Got here!\n");
return "yeah";
}
main()
{
strcmp(kk(), "yeah");
}
$ gcc -O2 -o kk kk.c
$ ./kk
Got here!
Got here!
Got here!
$ _
--
Juan Cespedes
--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-sparc-request@lists.debian.org .
Trouble? e-mail to templin@bucknell.edu .
Reply to: