[#523086] parisc/strstr.S broken

Thorsten Glaser <[email protected]> Wed, 24 Nov 2010 09:36:26 +0100 (CET)
Newsgroups gmane.linux.lib.dietlibc
Message-ID <[email protected]>
Hi,

I think you might not yet have seen it, since
RCS file: /cvs/dietlibc/parisc/strstr.S,v
Working file: strstr.S
head: 1.2
----------------------------
revision 1.2
date: 2003-09-16 16:27:33 +0200;  author: leitner;  state: Exp;  lines: +4 -2

/* reduced testcase */

#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

char Heuhaufen[] = "mad";

int main(void) {
	char *s, *buf, *cp;

	if ((buf = malloc(32)) == NULL)
		return (255);
	/* align */
	s = (void *)((((ptrdiff_t)buf + 15) & ~15) + 12);
	s[0] = 'a';
	s[1] = '\0';

	cp = strstr(Heuhaufen, s);
	free(buf);

	if (cp)
		printf("ok: <%s>\n", cp);
	else
		printf("broken\n");
	return (cp == NULL ? 1 : 0);
}

(sid)tg@paer:~$ diet cc rtc.c
/home/tg/dietlibc-0.32/debian/dietlibc-dev/usr/lib/diet/lib-parisc/libc.a(vprintf.o): In function printf':
/home/tg/dietlibc-0.32/libstdio/vprintf.c:13: warning: warning: the printf functions add several kilobytes of bloat.
(sid)tg@paer:~$ ./a.out
broken


The full text: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=523086
Easy solution: rm parisc/strstr.S
Correct fix would involve hppa asm, which I didn’t yet learn…
if you have someone at hand for this, that would be easier.

bye,
//mirabilos
-- 
Sometimes they [people] care too much: pretty printers [and syntax highligh-
ting, d.A.] mechanically produce pretty output that accentuates irrelevant
detail in the program, which is as sensible as putting all the prepositions
in English text in bold font.	-- Rob Pike in "Notes on Programming in C"