Date:        Mon, 25 Aug 2014 20:08:03 -0600
    From:        Sverre Froyen <[email protected]>
    Message-ID:  <[email protected]>

  | Does the NetBSD version originate with BSD? The man pages for FreeBSD,
  | OpenBSD and Mac OS X all have the same description.

Yes, and of course, as they all documented what the BSD implementation did
(that is just subtract bytes until a non-zero value resulted, or end of data).

But there never really was a requirement that it be implemented that way, an
architecture with a byte string compare instruction might leave the results
in the condition codes, which could be translated to -1, 0, 1 and meet the
implementation requirements - testing <0, ==0, or >0 are the only defined
actions on the result - any code assuming that the result tells the
magnitude of  the difference between the first bytes that differ (which
would be a truly bizarre thing to care about, given there's no way to
discover from the result which bytes differed) would be broken.

kre

Reply via email to