memicmp documentation

bridged with qdn.cafe
Post Reply
John A. Murphy

memicmp documentation

Post by John A. Murphy » Tue Oct 07, 2003 2:43 pm

If you compile and execute the example code included in the memicmp
documentation, you'll find it produces the output "Less than", whereas
it is documented as producing "Greater than". When the two objects
compared are not equal, the memicmp code returns the difference between
the original bytes, not the normalized bytes; thus 'W' is less than
'h'. While it's probably a bad idea to count on the sign of the result
when it's non-zero, an incorrect example certainly muddies the water.
Really complete documentation would mention what happens in the
implementation dependent case when the mismatch involves bytes in the
range 0x5B through 0x60. It may be best to simply say the function
returns zero if the objects are equal, and something else if they're
not.

Murf

Post Reply

Return to “qdn.cafe”