[Bug 38337] clang compiling warnings

wine-bugs at winehq.org wine-bugs at winehq.org
Tue Nov 10 22:59:25 CST 2015


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

--- Comment #10 from Dmitry Timoshkov <dmitry at 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'.

-- 
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