Mastering MISRA C++ Compliance with CppDepend. (original) (raw)

Mastering MISRA C++ Compliance with CppDepend

Understanding CppDepend Support for MISRA C++ Compliance

Introduction

In today's rapidly evolving automotive industry, the importance of reliable and safe software cannot be overstated. The Motor Industry Software Reliability Association (MISRA) plays a crucial role in establishing best practices for developing safety-related electronic systems in road vehicles and other embedded systems. As a collaborative effort between vehicle manufacturers, component suppliers, and engineering consultancies, MISRA aims to ensure the highest standards in software reliability.

One essential tool for achieving MISRA C++ compliance is CppDepend, which helps developers adhere to these stringent guidelines. In this comprehensive guide, we will explore the pivotal role of MISRA in the automotive industry and how CppDepend can support developers in creating safer, more reliable software for vehicles and embedded systems.

To learn Misra C++ Standards, you can print the official Misra C++ 2008 Standard documentation.

Using Misra Rules in CppDepend

When you create a new CppDepend Project, a pop-up will appear displaying all the coding standards you would like to include in your analysis. To include MISRA C++ coding standards, check the MISRA option and choose MISRA C++.

misra c++ rules in CppDepend

After analyzing your project, Navigate to the Queries and Rules Explorer section, and select the Misra Rules from the left-hand menu (Highlighted in red in the image below). This will display all the related Misra rules on the right. Upon clicking a Rule, the corresponding CQLinq query and the relevant source code will be automatically generated. Additionally, the Metrics View section provides a visualization of the issue's location and significance.

misra c++ rules in CppDepend

Incorporating Misra Rules into the HTML Report

To include the Misra rules in the generated HTML Report (available in the DevOps Edition), simply right-click on the Misra group and select "List Code Queries of this Group in a dedicated section in Report."

Add Misra Rules to Report

List of Misra C++ Rules

CppDepend offers support for 103 Misra C++ standard queries.

To gain a deeper understanding of each rule and its functionality, please consult the officialMisra C++ 2008 Standard documentation.

Uncessary Constructs

Storage

Lexical Conventions

Basic Concepts

Standard Conversions

Expressions

Statements

Declarations

Declarators

Classes

Exceptions

Preprocessor

Library

Go to top