Skip to content

Comments

Fix #11389 unnecessary trunc long cast return - part2#8243

Draft
ceJce wants to merge 5 commits intodanmar:mainfrom
ceJce:fix11389_unnecessary_truncLongCastReturn_part2
Draft

Fix #11389 unnecessary trunc long cast return - part2#8243
ceJce wants to merge 5 commits intodanmar:mainfrom
ceJce:fix11389_unnecessary_truncLongCastReturn_part2

Conversation

@ceJce
Copy link
Contributor

@ceJce ceJce commented Feb 20, 2026

No description provided.


if (op->str() == "<<") {
// If the lefthand operand is 31 or higher the resulting shift will be a negative value or greater than int range.
if ((rightRange->first >= INTEGER_SHIFT_LIMIT) || rightRange->second >= INTEGER_SHIFT_LIMIT)

Check warning

Code scanning / Cppcheck Premium

An unsigned arithmetic operation with constant operands should not wrap Warning

An unsigned arithmetic operation with constant operands should not wrap

if (op->str() == "<<") {
// If the lefthand operand is 31 or higher the resulting shift will be a negative value or greater than int range.
if ((rightRange->first >= INTEGER_SHIFT_LIMIT) || rightRange->second >= INTEGER_SHIFT_LIMIT)

Check warning

Code scanning / Cppcheck Premium

An unsigned arithmetic operation with constant operands should not wrap Warning

An unsigned arithmetic operation with constant operands should not wrap
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant