What is MISRA C/C++?

March 13, 2025
Part 1 of this series on MISRA C/C++ focuses on why the tool is useful for any C/C++ developer.

What you’ll learn:

  • What is MISRA C/C++?
  • Why MISRA C/C++ helps in the development of safe and secure software.
  • Why MISRA C/C++ isn’t just for automotive software development.

 

MISRA C and MISRA C++ are software-development guidelines designed to facilitate the development of safe and secure applications. MISRA C was started in 1997 by the MISRA Consortium, targeting automotive applications.

This is the first in a three-part series of videos and articles examining MISRA C/C++. I talked with Andrew Banks, Technical Specialist at LDRA/TASKING, about MISRA C/C++ (watch the video above).

C and C++ are programming languages designed to provide developers with unfettered access to hardware. They also put the onus on the programmer to not make mistakes, since an application tends to have access to the underlying system. Both have features that can be accidentally misused, and some areas with the language implementation are open to interpretation.

>>Check out this TechXchange for similar articles and videos

112085047 © Monsit Jangariyawong | Dreamstime.com
misra_c_promo_txc_112085047__monsit_jangariyawong_
TechXchange

MISRA C/C++ for Writing Better Software

Originally developed for safety-critical automotive software, MISRA C/C++ standards have expanded to other areas of the electronics industry.

MISRA C/C++ limit the functionality of the programming language to ensure consistent use and operation, as well as make sure the programmer avoids error-prone features. The guidelines are a collection of rules, most of which can be implemented using static analysis.

How Does MISRA C/C++ Work?

MISRA C/C++ is typically implemented as part of a static-analysis tool designed to catch programming errors at compile time rather than runtime. Programmers can usually select which rules are to be applied, and code that doesn’t meet the requirements is flagged as an error.

Most static-analysis tools run prior to compiling, although some are implemented as part of the compiler. Most C/C++ compilers have flags that can be set to check for issues identical to some MISRA rules, but not all.

Where is MISRA C/C++ Used?

Though MISRA C originally targeted automotive applications, it’s been adopted by many other industries, ranging from transportation to medical. MISRA C/C++ support is useful for any C/C++ developer, as it will help reduce the number of errors in the code.

The AnalysisTools website lists static-analysis tools for C/C++ as well as other programming languages. Most of those for MISRA C/C++ are commercial offerings. Many open-source tools are able to provide support for most MISRA C/C++ rules, but not all of them. They also provide additional analysis that can be useful.

Preventing bugs in software is usually the goal of any programmer. Code quality matters and MISRA C/C++ can help.

>>Check out this TechXchange for similar articles and videos

112085047 © Monsit Jangariyawong | Dreamstime.com
misra_c_promo_txc_112085047__monsit_jangariyawong_
TechXchange

MISRA C/C++ for Writing Better Software

Originally developed for safety-critical automotive software, MISRA C/C++ standards have expanded to other areas of the electronics industry.
About the Author

William G. Wong | Senior Content Director - Electronic Design and Microwaves & RF

I am Editor of Electronic Design focusing on embedded, software, and systems. As Senior Content Director, I also manage Microwaves & RF and I work with a great team of editors to provide engineers, programmers, developers and technical managers with interesting and useful articles and videos on a regular basis. Check out our free newsletters to see the latest content.

You can send press releases for new products for possible coverage on the website. I am also interested in receiving contributed articles for publishing on our website. Use our template and send to me along with a signed release form. 

Check out my blog, AltEmbedded on Electronic Design, as well as his latest articles on this site that are listed below. 

You can visit my social media via these links:

I earned a Bachelor of Electrical Engineering at the Georgia Institute of Technology and a Masters in Computer Science from Rutgers University. I still do a bit of programming using everything from C and C++ to Rust and Ada/SPARK. I do a bit of PHP programming for Drupal websites. I have posted a few Drupal modules.  

I still get a hand on software and electronic hardware. Some of this can be found on our Kit Close-Up video series. You can also see me on many of our TechXchange Talk videos. I am interested in a range of projects from robotics to artificial intelligence. 

Sponsored Recommendations

Comments

To join the conversation, and become an exclusive member of Electronic Design, create an account today!