9front - general discussion about 9front
 help / color / mirror / Atom feed
* strchr definition
@ 2014-12-07  5:06 brz-systemd-dev
  2014-12-07  5:46 ` [9front] " Iruatã Souza
  2014-12-07 13:25 ` cinap_lenrek
  0 siblings, 2 replies; 3+ messages in thread
From: brz-systemd-dev @ 2014-12-07  5:06 UTC (permalink / raw)
  To: 9front

I seem to be finding conflicting definitions of strchr

strcat(2)
	char* strchr(char *s, char c)

/sys/src/libc/port/strchr.c
	char* strchr(char *s, int c)

/sys/include/libc.h:/strchr/
	extern	char*	strchr(char*, int);

So it seems like it takes an int, rather than a char.
But referencing the 386 asm, this is seen.
/sys/src/libc/386/strchr.s:4: MOVB c+4(FP), AX
                                           (^ Why a 16-bit register?)
Is there a reason for these seemingly divergent definitions?


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-12-07 13:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-07  5:06 strchr definition brz-systemd-dev
2014-12-07  5:46 ` [9front] " Iruatã Souza
2014-12-07 13:25 ` cinap_lenrek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).