Skip to content

Conversation

@tlsa
Copy link
Member

@tlsa tlsa commented Sep 20, 2025

This fixes a few CodeQL issues.

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

    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 c56188d into master Sep 20, 2025
6 checks passed
@tlsa tlsa deleted the tlsa/code-ql-fixes branch September 20, 2025 16:40
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