gcc compile the example that you find in attach  without errors

ciao
Emiliano
#include <stdio.h>

static inline char * strrchr(const char * s, int c)
{
int d0, d1;
register char * __res;
__asm__ __volatile__(
	"movb %%al,%%ah\n"
	"1:\tlodsb\n\t"
	"cmpb %%ah,%%al\n\t"
	"jne 2f\n\t"
	"leal -1(%%esi),%0\n"
	"2:\ttestb %%al,%%al\n\t"
	"jne 1b"
	:"=g" (__res), "=&S" (d0), "=&a" (d1)
	:"0" (0),"1" (s),"2" (c)
	:"memory");
return __res;
}

struct test { char* a; };
int main(int argc,char** argv){
		
	struct test *l;
	l =  malloc(sizeof(struct test));
	l->a = "prova.el\0";
	char* p = strrchr(l->a,'.');
	p = strrchr(l->a,'.');
	printf("prova %s",p);
	return 0;
}

Reply via email to