[Bug 46662] New: absolute value of unsigned type 'unsigned int' has no effect
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(a)winehq.org Reporter: isakov-sl(a)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.
https://bugs.winehq.org/show_bug.cgi?id=46662 --- Comment #1 from Sergey Isakov <isakov-sl(a)bk.ru> --- A possible solution is to cast to (int) -- 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.
https://bugs.winehq.org/show_bug.cgi?id=46662 --- Comment #2 from Sergey Isakov <isakov-sl(a)bk.ru> --- It looks like fixed in new wines -- 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.
https://bugs.winehq.org/show_bug.cgi?id=46662 Austin English <austinenglish(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |FIXED --- Comment #3 from Austin English <austinenglish(a)gmail.com> --- (In reply to Sergey Isakov from comment #2)
It looks like fixed in new wines
Fixed. -- 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.
https://bugs.winehq.org/show_bug.cgi?id=46662 Nikolay Sivov <bunglehead(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|-unknown |d3d Fixed by SHA1| |c635f95518d50ed4e85ddf3fd4b | |283a7c6853d58 --- Comment #4 from Nikolay Sivov <bunglehead(a)gmail.com> --- Appears to be a 5 years old change. I didn't check gdiplus/image.c since there was no diff for it in the original description. -- 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.
https://bugs.winehq.org/show_bug.cgi?id=46662 Alexandre Julliard <julliard(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #5 from Alexandre Julliard <julliard(a)winehq.org> --- Closing bugs fixed in 10.4. -- 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.
participants (2)
-
wine-bugs@winehq.org -
WineHQ Bugzilla