Skip to content

Conversation

@tlsa
Copy link
Member

@tlsa tlsa commented Sep 20, 2025

Squash CodeQL cpp/unsigned-difference-expression-compared-zero issue.

This rule finds relational comparisons between the result of
an unsigned subtraction and the value `0`. Such comparisons
are likely to be wrong as the value of an unsigned subtraction
can never be negative. So the relational comparison ends up
checking whether the result of the subtraction is equal to 0.
This is probably not what the programmer intended.

Squash CodeQL `cpp/unsigned-difference-expression-compared-zero`
issue.

    This rule finds relational comparisons between the result of
    an unsigned subtraction and the value `0`. Such comparisons
    are likely to be wrong as the value of an unsigned subtraction
    can never be negative. So the relational comparison ends up
    checking whether the result of the subtraction is equal to 0.
    This is probably not what the programmer intended.
@tlsa tlsa merged commit cabf9fc into master Sep 20, 2025
6 checks passed
@tlsa tlsa deleted the tlsa/fix-code-ql branch September 20, 2025 19:21
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.

2 participants