2002-11-18 Theodore A. Roth * libc/string/memcmp.S: Add note about unsigned nature of compare. Index: libc/string/memcmp.S =================================================================== RCS file: /cvsroot/avr-libc/avr-libc/libc/string/memcmp.S,v retrieving revision 1.3 diff -u -r1.3 memcmp.S --- libc/string/memcmp.S 5 Aug 2002 19:21:36 -0000 1.3 +++ libc/string/memcmp.S 18 Nov 2002 22:21:44 -0000 @@ -43,11 +43,16 @@ \brief Compare memory areas The memcmp() function compares the first len bytes of the memory areas s1 - and s2. + and s2. The comparision is performed using unsigned char operations. \returns The memcmp() function returns an integer less than, equal to, or greater than zero if the first len bytes of s1 is found, respectively, to be - less than, to match, or be greater than the first len bytes of s2. */ + less than, to match, or be greater than the first len bytes of s2. + + \note Be sure to store the result in a 16 bit variable since you may get + incorrect results if you use an unsigned char or char due to truncation. + + \warning This fucntion is not -mint8 compatible. */ .text .global _U(memcmp)