Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suppress warnings in comments #43

Closed
byakuren-hijiri opened this issue Jul 29, 2024 · 1 comment · Fixed by #203
Closed

Suppress warnings in comments #43

byakuren-hijiri opened this issue Jul 29, 2024 · 1 comment · Fixed by #203
Assignees
Labels
area:warnings Related to how Misti processes and emits detector warnings
Milestone

Comments

@byakuren-hijiri
Copy link
Contributor

byakuren-hijiri commented Jul 29, 2024

We would like to have something like this:

// @misti-suppress DivideBeforeMultiply
let a = (a / MAX_VAL) * 3;

To implement warning suppressions in the source code, such as in comments, it would be nice to have these in the syntax tree. This should be done in the compiler first.

@byakuren-hijiri byakuren-hijiri added blocked area:warnings Related to how Misti processes and emits detector warnings labels Jul 29, 2024
@byakuren-hijiri byakuren-hijiri self-assigned this Jul 29, 2024
@byakuren-hijiri byakuren-hijiri added this to the v0.2 milestone Aug 4, 2024
@jubnzv jubnzv assigned jubnzv and unassigned byakuren-hijiri Aug 6, 2024
@jubnzv jubnzv modified the milestones: v0.2, v0.3 Aug 20, 2024
@jubnzv jubnzv modified the milestones: v0.3, v0.4 Sep 21, 2024
@jubnzv jubnzv changed the title Suppress warnings Suppress warnings in comments Sep 27, 2024
@jubnzv
Copy link
Member

jubnzv commented Oct 17, 2024

One option for how it could be implemented without comments in the CST is to parse the line above the warning shown in the warning message:

[INFO] AsmIsUsed: asm function is used
test/detectors/AsmIsUsed.tact:2:1:
  1 | // @misti-suppress AsmIsUsed
> 2 | asm(-> 1 0) extends mutates fun loadRefEx(self: Slice): Cell { LDREF }
      ^
  3 |
Help: Using TVM assembly is a potentially dangerous operation that requires additional review
See: https://nowarp.io/tools/misti/docs/detectors/AsmIsUsed

@jubnzv jubnzv removed the blocked label Oct 17, 2024
jubnzv added a commit that referenced this issue Oct 29, 2024
jubnzv added a commit that referenced this issue Oct 29, 2024
@jubnzv jubnzv closed this as completed in 3c31e7f Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:warnings Related to how Misti processes and emits detector warnings
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants