Skip to content

False positive running MISRA C 2012 Rule 13.4 #150

@kylejacksonb

Description

@kylejacksonb

There is odd behaviour, in that if we comment the first definition the violation is no longer reported.

struct MYPORT
{
    char a;
} *PORT;

#define FetOff (PORT->a = 1)    // Comment this line and the next is not reported
#define FetOn (PORT->a = 1)     // MISRA12_13.4    - Result of an assignment operator was used

Attached is a more complete example of the original code.

example.txt

Metadata

Metadata

Assignees

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