[Bug 38337] clang compiling warnings

wine-bugs at winehq.org wine-bugs at winehq.org
Tue Nov 10 22:57:56 CST 2015


https://bugs.winehq.org/show_bug.cgi?id=38337

--- Comment #9 from Dmitry Timoshkov <dmitry at baikal.ru> ---
(In reply to Sergey Isakov from comment #8)
> 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.

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.



More information about the wine-bugs mailing list