Safer C++ with MISRA-C++-2023

Peter Sommerlad

⏱ 90 minute session
intermediate
advanced
11:00-12:30, Thursday, 18th April 2024
MISRA guidelines and corresponding static analysis tooling exist to foster programming practices that are considered important for safety-critical systems, especially in the automotive industry.

In application areas where human live or capital is at risk, safe and secure code is a must, but even in other domains the internal quality of C++ programs is an important factor for programmers' effectiveness. Adhering to MISRA-C++ can help to achieve better internal quality, reducing the risk of undefined behavior and portability issues through implementation-defined behavior.

Since the original MISRA-C++:2008 guidelines that addressed C++03, five new C++ standards were released. While inherently conservative, an update to the MISRA-C++ guidelines was prepared and is released in 2023 adressing C++17.

This talk will give an overview of why and what MISRA-C++:2023 attempts to achieve as well as demonstrate some example MISRA-C++ rules and how modern C++ design already fulfils them. Some seemingly surprising guidelines are shown and explained, why such "unachievalbe" guidelines exist and the rationale behind those guidelines that one seemingly must violate. For example, an advisory guideline forbids to write your own loops, except for a few cases, which sounds ridiculous on first sight. The talk will show a few cases how to work around but also tells you not to sweat it to hard, but reminds you that getting loop statements correct is really hard.

Peter Sommerlad

Peter Sommerlad is a consultant and trainer for Safe Modern C++ and Agile Software Engineering.

Peter Sommerlad is a consultant and trainer for Safe Modern C++ and Agile Software Engineering. Peter was professor at and director of IFS Institute for Software at FHO/HSR Rapperswil, Switzerland until February 2020. Peter is co-author of POSA Vol.1 and Security Patterns. He inspired the C++ IDE Cevelop with a unique C++ feedback, refactoring, and code modernization experience. Peter is a member of MISRA-C++, Hillside, ACM, IEEE Computer Society, ACCU, ISO WG23 and the ISO WG21 C++ committee. Contact

E-Mail: peter.cpp@sommerlad.ch Links

https://sommerlad.ch