[Bug 40136] New: directx.c:4425:5: warning: comparison of unsigned expression < 0 is always false
https://bugs.winehq.org/show_bug.cgi?id=40136 Bug ID: 40136 Summary: directx.c:4425:5: warning: comparison of unsigned expression < 0 is always false Product: Wine Version: 1.9.3 Hardware: x86 OS: Linux Status: NEW Severity: normal Priority: P2 Component: directx-d3d Assignee: wine-bugs(a)winehq.org Reporter: wylda(a)volny.cz Distribution: --- Noticed during compilation of wine-1.9.3-217-g0f8a0fd on older Debian Wheezy: /wine_git_build/dlls/wined3d/directx.c: In function ‘wined3d_check_device_multisample_type’: /wine_git_build/dlls/wined3d/directx.c:4425:5: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] -- 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=40136 Wylda <wylda(a)volny.cz> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |source Distribution|--- |Debian --- Comment #1 from Wylda <wylda(a)volny.cz> --- Filling some fields... -- 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=40136 Sergey Isakov <isakov-sl(a)bk.ru> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |isakov-sl(a)bk.ru --- Comment #2 from Sergey Isakov <isakov-sl(a)bk.ru> --- This is wrong programming style to check if enum type variable have a value out of enum range. For my mind the check must be at the function call and not inside the function. Yes, the expression will never be < 0, this check is redundant. -- 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=40136 --- Comment #3 from Nikolay Sivov <bunglehead(a)gmail.com> --- Why is that wrong? Function validates its argument, which can be anything. Whether enum integer type is signed or not is compiler specific, for gcc and this particular enum it will be unsigned int most likely, so more reliable check would be to use (unsigned int)multisample_type > WINED3D_MULTISAMPLE_16_SAMPLES. -- 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=40136 --- Comment #4 from Sergey Isakov <isakov-sl(a)bk.ru> --- It is not an error, it is redundant codes. -- 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=40136 Matteo Bruni <matteo.mystral(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |INVALID --- Comment #5 from Matteo Bruni <matteo.mystral(a)gmail.com> --- I guess we could cast to unsigned and only check for > WINED3D_MULTISAMPLE_16_SAMPLES as Nikolay wrote but I don't see the current code being wrong in any way. Newer gcc doesn't complain, I guess the check became smarter. -- 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=40136 Austin English <austinenglish(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #6 from Austin English <austinenglish(a)gmail.com> --- Closing. -- 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 (1)
-
wine-bugs@winehq.org