[Bug 46662] New: absolute value of unsigned type 'unsigned int' has no effect

wine-bugs at winehq.org wine-bugs at winehq.org
Sun Feb 17 01:40:09 CST 2019


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

            Bug ID: 46662
           Summary: absolute value of unsigned type 'unsigned int' has no
                    effect
           Product: Wine
           Version: 4.2
          Hardware: x86
                OS: Mac OS X
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: -unknown
          Assignee: wine-bugs at winehq.org
          Reporter: isakov-sl at bk.ru

I compiled in macOS with clang and see numerous messages like this
~~~~
/Volumes/MacHD/Users/sergey/Documents/Projects/wine/dlls/d3d12/tests/d3d12.c:28:9:
warning: 
      taking the absolute value of unsigned type 'unsigned int' has no effect
[-Wabsolute-value]
    if (abs((c1 & 0xff) - (c2 & 0xff)) > max_diff)
        ^
/Volumes/MacHD/Users/sergey/Documents/Projects/wine/dlls/d3d12/tests/d3d12.c:28:9:
note: remove
      the call to 'abs' since unsigned values cannot be negative
    if (abs((c1 & 0xff) - (c2 & 0xff)) > max_diff)
        ^~~
~~~
Let me explain it is not negligible. It is error.
For example c2 = 8, c1 = 7
abs(c1 - c2) = 0xFFFFFFFF > max_diff
The condition is TRUE!!!

There is other places, not only in tests, for example
dlls/gdiplus/image.c
and hundreds such mistakes.

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