FreeBSD’s libc implementation of strcmp() appears to find the first two characters that differ, and return the difference between them.
Whereas valgrind’s strcmp() only returns a value from the set {-1,0,1}
I don’t have a Linux system to compare as I took my Linux PC to bits.
What does the C Standard say about this? I don’t own a copy.
I just (perhaps stupidly) wrote a function that relied on FreeBSD’s behaviour and had to spend about an hour investigating why my program fails under valgrind!
Whereas valgrind’s strcmp() only returns a value from the set {-1,0,1}
I don’t have a Linux system to compare as I took my Linux PC to bits.
What does the C Standard say about this? I don’t own a copy.
I just (perhaps stupidly) wrote a function that relied on FreeBSD’s behaviour and had to spend about an hour investigating why my program fails under valgrind!