Skip to content

misra: fix rule 5.4 false positive#2125

Merged
danmar merged 1 commit intocppcheck-opensource:masterfrom
conradoplg:fix-misra-5.4-false-positive
Aug 31, 2019
Merged

misra: fix rule 5.4 false positive#2125
danmar merged 1 commit intocppcheck-opensource:masterfrom
conradoplg:fix-misra-5.4-false-positive

Conversation

@conradoplg
Copy link
Copy Markdown
Contributor

I apologize if I'm jumping the gun since I'm evaluating cppcheck but I don't have a copy of the MISRA rules yet. But from I've deduced, cppcheck misra.py raises a false positive when a macro is defined "twice" in a #if/#else, e.g.

#ifdef misra_5_4_macro_hides_macro__31x
#define misra_5_4_macro 1 // no warning
#else
#define misra_5_4_macro 2 // no warning
#endif

misra.py thinks these are two distinct macros that have the same 31/63-character prefix, which would violate rule 5.4.

@danmar danmar merged commit 3740c57 into cppcheck-opensource:master Aug 31, 2019
@danmar
Copy link
Copy Markdown
Collaborator

danmar commented Aug 31, 2019

Thanks! I agree, that was a FP.

jubnzv pushed a commit to jubnzv/cppcheck that referenced this pull request Nov 13, 2019
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