You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The bug is found in the checker for MISRA C++ 2008 Rule 6–5-6, which states that loop control variables in a for loop, other than the loop counter itself, should have the type bool to make the program easier to read. The analyzer seems to apply this rule to any loop control variable even if they are not changed inside the loop.
For example, the following snippet of code compares the loop counter i with a const size_t variable, which is guaranteed to never change:
This is flagged by Analyze as a rule 6-5-6 violation, possibly due to the usage of the variable len within the loop condition, even though this is a const variable.
To Reproduce
Steps to reproduce the behavior:
Analyze any code with a for loop that has a variable in the loop condition as stated above
The analyzer software will report this as a 6-5-6 violation
Expected behavior
The violation should not be flagged by the software.
Desktop (please complete the following information):
OS: Fedora 40 running Analyze through Podman
Version: latest
The text was updated successfully, but these errors were encountered:
Describe the bug
The bug is found in the checker for MISRA C++ 2008 Rule 6–5-6, which states that loop control variables in a for loop, other than the loop counter itself, should have the type
bool
to make the program easier to read. The analyzer seems to apply this rule to any loop control variable even if they are not changed inside the loop.For example, the following snippet of code compares the loop counter
i
with aconst size_t
variable, which is guaranteed to never change:This is flagged by Analyze as a rule 6-5-6 violation, possibly due to the usage of the variable
len
within the loop condition, even though this is aconst
variable.To Reproduce
Steps to reproduce the behavior:
Expected behavior
The violation should not be flagged by the software.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: