Top "Misra" questions

MISRA (originally an abbreviation of Motor Industry Software Reliability Association) is an organization which has published the coding guidelines called MISRA-C and MISRA-C++. Each document is a set of rules aiming to create a safer sub-set of the respective language.

Free tools to check compliance with MISRA C?

Are there any open-source or free tools out there, that check the MISRA C compliance?

c standards misra
What is the benefit of terminating if … else if constructs with an else clause?

Our organization has a required coding rule (without any explanation) that: if … else if constructs should be terminated with an …

c misra
Is there a way to make an enum unsigned in the C90 standard? (MISRA-C 2004 compliant)

I'm trying to find a way to make an enum "unsigned". enum{ x1 = 0, x2, x3 }; uint8_t = x2; /* <--- …

c enums standards misra
Why did my tool throw a MISRA error here?

What can I do to avoid MISRA giving this error for the code below? I tried casting with (unit16_t). …

c misra
What's the difference between "dead code" and "unreachable code"?

I thought those terms where synonymous, but a note in MISRA regarding dead code indicates this to be wrong? What's …

standards standards-compliance misra
C/C++ conditional return statements

I am working on embedded program and in certain cases if a condition is not meant, I would like to …

c++ c misra
rationale behind Misra 2012 not allowing cast between different pointers

I am currently working on a project which requires the code to be Misra 2012 compliant. Throughout the project we have …

c misra
MISRA incrementation in C

While debugging some embedded code, I came across something like this: buffPtr = &a[5]; buffEndPtr = &a[10]; while (buffPtr != buffEndPtr) { *…

c pointers embedded misra
Why "continue" is considered as a C violation in MISRA C:2004?

MISRA 14.5 says continue statement must not be used. Can anyone explain the reason? Thank you.

c misra