[Bug 37482] Suspicious condition (assignment + comparison); Clarify expression with parentheses. (Cppcheck)

wine-bugs at winehq.org wine-bugs at winehq.org
Fri Oct 31 06:05:27 CDT 2014


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

--- Comment #2 from Bruno Jesus <00cpxxx at gmail.com> ---
(In reply to Michael Stefaniuc from comment #1)
> I would say clang is misguided here. Not sure why it complains here as
>     y = comparison ? foo : bar
> is the standard way of doing this and adding paranthesis would be bad style.
> 
> Can you please report it to them as false positive?

Ok, I think the program was misguided because the false branch is very long,
thinking that some compiler could do things like:

y = (Origin.y > 1 ? Origin.y - 1 : itemheight) - 1 + Origin.y % itemheight
y = (Origin.y > 1 ? Origin.y - 1 : itemheight - 1) + Origin.y % itemheight
y = (Origin.y > 1 ? Origin.y - 1 : itemheight - 1 + Origin.y) % itemheight
y = (Origin.y > 1 ? Origin.y - 1 : itemheight - 1 + Origin.y % itemheight)

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