Skip to content

Conversation

@firewave
Copy link
Collaborator

these are shown with a make build using Clang


bool CheckCondition::diag(const Token* tok1, const Token* tok2)
{
bool b = diag(tok1);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe spell out the logic in a comment? We always mark both tokens as diagnosed.
Could also use two variables: return b1 && b2;

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe spell out the logic in a comment?

I never understood the logic. Care to provide a comment to add?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

diag(tok) marks a token as diagnosed and returns true if it was already marked. diag(tok1, tok2) therefore needs to mark both tokens. // mark both tokens would probably be enough.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

these are shown with a make build using Clang
@sonarqubecloud
Copy link

@chrchr-github chrchr-github merged commit 9dd0555 into danmar:main Aug 18, 2025
63 checks passed
@firewave firewave deleted the diag-bitwise branch August 18, 2025 08:23
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