Ángel

@angel@triptico.com



curmudgeon / cascarrabias

Websitehttps://triptico.com
tilde.clubhttps://tilde.club/~angel/
Ann Hell Musichttps://exode.me/accounts/annhell
GPG KeyB498DDC28F4584FF
1 ★ 0 ↺

Ángel »
@angel@triptico.com

Linux's strcmp() For The m68k Has Always Been Broken:
The m68 hand-written assembler version of strcmp() has always been broken: it returns the difference between the first non-matching byte done as a 8-bit subtraction.

That is _almost_ right, but is broken for the overflow case. The strcmp() function should indeed return the sign of the difference between the first byte that differs, but the subtraction needs to be done in a wider type than 'char'. Otherwise the ordering isn't actually stable.

https://www.phoronix.com/news/Linux-m68k-strcmp-Always-Broken

History