https://bugs.winehq.org/show_bug.cgi?id=38337
--- Comment #10 from Dmitry Timoshkov dmitry@baikal.ru --- (In reply to Dmitry Timoshkov from comment #9)
But next attempt make crazy!
int main() { unsigned short x = 3, y = 5, z; z = x - y; printf(" results: %d, abs=%d\n", z, abs(z)); }
results: 65534, abs=65534
If there is unsigned short then the result is bad!
The result is perfectly correct. You need to add explicit casts to (signed int)z and abs((signed int)z) if you want to unbreak it.
Or rather cast to 'signed short'.