Bug in ffs() library function?
Donn Seeley
donn at utah-cs.UUCP
Tue Sep 18 11:25:25 AEST 1984
Actually the bug is undoubtedly in the documentation... Under the
manual section 'bstring' we read:
A return value of -1 indicates that the value passed is zero.
But a look at the source (and the kernel asm.sed) shows that 0 is
returned for zero. I assume that the code is right and the manual page
is wrong. Although my knowledge of Sun assembler is close to zip, it
would appear that the same inconsistency exists in the Sun 1.1
distribution.
Unless ffs() returns 0 for zero, you lose the only good reason to
number the bits from 1 instead of from 0... (Growl.)
Donn Seeley University of Utah CS Dept donn at utah-cs.arpa
40 46' 6"N 111 50' 34"W (801) 581-5668 decvax!utah-cs!donn
More information about the Comp.bugs.4bsd.ucb-fixes
mailing list