Skip to content

LGTM.com - false positive Assignment where comparison was intended #5318

@dscho

Description

@dscho

"Assignment where comparison was intended" suggests to surround assignment with parentheses, but that's already the case.

I actually run this in a GitHub workflow. The code in question is here: https://github.com/dscho/git/blob/2ab72e89eeff833e248b77256cfa2f59893f3442/ident.c#L175-L175

This rule kicks in and warns about it: https://github.com/github/codeql/blob/main/cpp/ql/src/Likely%20Bugs/Likely%20Typos/AssignWhereCompareMeant.ql

The recommendation suggests that "it may be better to surround it with parentheses.", but that is clearly already the case.

cc: @MathiasVP

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions