Skip to content

Understand: MISRA C 2023 Rule 13.3 - Loop Error #155

@kylejacksonb

Description

@kylejacksonb

While working on a potential FP, I introduced an error for the MISRA C 2012/2023 Rule 13.3 check (build 1239). By turning over the last expression of the for loop, it appears to cause problems reading the next token:

void foo(int p)
{
    int idx;
    for (idx = p; idx <= p;
            idx++) { }
}
Traceback (most recent call last):
File "D:/Programme/SciTools/plugins/CodeCheck/Published Standards/MISRA C 2023/MISRA23_13.3/check.upy", line 224, in check
lex = lex.next(True, True)
^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'next'

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions